Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Atif Hussain
Linking Content. There should be an option : "Select a content as link"
April 26, 2013 1:07 AM
Answer

Atif Hussain

Rank: Junior Member

Posts: 47

Join Date: April 3, 2012

Recent Posts

There is a feature , that I feel is missing, is linking content to other content. Although Liferay provides Related assets feature, but this is not enough for some cases.
I took a snap shot of Wikipedia, I hope this will help in understanding.
At the moment is not much easy to find the URL of Web content, and then make its Hyperlink using Text Box(HTML) in WCM Structure. I have found someone saying , to add every content on a page (as a page has friendly URL, so it would be easy to know the URL of Content). But this technique would be too costly if you have thousands of contents.

In my case, I have a structure named "Magazine News" with fields Magazine_Name, Magazine_Publisher and Date_Published.
So when I add a content of type Magazine News, I provide Magazine Name, Magazine Publisher and Date Published. Here I want Magazine_Name to be a Hyperlink to other Content which is of type Magazine.
Attachment

Attachments: CMS_Content_Linking.jpg (272.0k)
Juan Fernández
RE: Linking Content. There should be an option : "Select a content as link"
April 26, 2013 2:04 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1250

Join Date: October 2, 2008

Recent Posts

Hi Atif Hussain:
I see this is very interesting. Recently we've been told that it would be useful to have related assets as fields of the structures, that way, from the template you could get the link and display it as part of the article. What do you think about having a new field type in the structure called "Related asset" that allows you to add a link to an asset and then print the link easily in the template? Do you think it will cover your use case?
Thanks for the feedback
Juan
Atif Hussain
RE: Linking Content. There should be an option : "Select a content as link"
April 26, 2013 2:52 AM
Answer

Atif Hussain

Rank: Junior Member

Posts: 47

Join Date: April 3, 2012

Recent Posts

Thanks Juan for prompt response. Your proposed solution is good.
1) But I see a few limitations in your solution. If you add Related Asset as a field of the structure, the field will contain only the link. It would be great if this field can have simple text + link. In addition to this,in the front of this field(related asset) there should be a Popup/Drop Down Selection List which will display all the available contents (Blogs/Wiki, Web Content etc) and user should be able to select any content.

2) An other idea can be: If on add Web Content page,there should be Popup/Drop Down Selection List button, which will display all the available contents (Blogs/Wiki, Web Content etc) with their URL, the user will search its desired content, copy its URL and paste in Text Box(HTML) as anchor. So this way both limitation that I have mention above can be solved.
Juan Fernández
RE: Linking Content. There should be an option : "Select a content as link"
April 26, 2013 3:13 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1250

Join Date: October 2, 2008

Recent Posts

Hi Atif:
I don't want users to work copying and pasting URLs from one place to another: it is a really bad practise for any product, so I wouldn't like it to see on Liferay. But you have a point in you point 1), I like it. Actually, when linking the asset it would be really nice to be able to:

1) Give the relationship a name
2) Provide for a text input with the text of the link (this would be optional, in case you want to show just the URL visible)

In your case, you'll create a structure with a field whose name would be "Magazine Name" of type "Related asset". When creating the content, you'll click on "Select related asset" which will open the related assets browser, then you'll look for a web content and will give it a name (for example: "My cool tech magazine") and then in the template you'll do something like $magazine_name.getData() and it'll generate the correct HTML for it.

Will that be enough for you or am I missing something?
Juan
Atif Hussain
RE: Linking Content. There should be an option : "Select a content as link"
April 26, 2013 3:58 AM
Answer

Atif Hussain

Rank: Junior Member

Posts: 47

Join Date: April 3, 2012

Recent Posts

You have got good reason for not allowing users Copying and Pasting URLs. So your solution is fit for my scenario.

One thing I need to know is would I be able to do like "This is my new My cool tech magazine" using Related Assets Field.
Please note the format "Some Text with a URL", would I be able to add a URL with any text in related asset field.
Although only URL fulfills my requirement but addition of other text will be a bonus and any idea when this feature will be available.
Thanks for the assistance.

Regards,
Atif Hussain
Juan Fernández
RE: Linking Content. There should be an option : "Select a content as link"
April 26, 2013 4:24 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1250

Join Date: October 2, 2008

Recent Posts

Hum... I see... that is weird...

Maybe this is not the right approach for your specific use case. It seems that your process is that when you are writing a content and then selecting a word (or sentence) with your mouse, and when you want to convert it to link using WYSIWYG CKEditor - then there should be an option to select the right content or page.

This approach would be quite different, as it would require to extend the CKEditor URL browser (see screenshot)
Attachment

Attachments: LinkRelatedAssets.png (101.6k)
Atif Hussain
RE: Linking Content. There should be an option : "Select a content as link"
April 26, 2013 5:25 AM
Answer

Atif Hussain

Rank: Junior Member

Posts: 47

Join Date: April 3, 2012

Recent Posts

Yes this is what i was saying. It may seems weird but can help users in many ways.On the screen shot you shared, Press Browse Server and you should see all the Contents (Web Content, WIKI, Blog etc.).

But a Related Asset type field in structure will be ok, for basic linking of contents.