News item WYSIWYG - linking to another asset

Hi,


I have created a link to another asset in the body contents of a news item. When I view this asset and click on the link, only the contents of the linked page are displayed. The full web path looks like www.example.com/news/?a=1000



I can usually get around this by linking to the full url, eg http://www.example.com/sectionB, but this is awkward.



I’ve noticed that this is http://www.example.com/sectionB, so what should I do to get the whole page to appear and not just the contents?



Thanks

Does your /news/ site have a design applied to it?


yes.. and a paint layout to display the news item.

What version of MySource Matrix are you running?

running v3.16.3

I have noticed that any link in the body contents are not expanded and end up looking like this www.example.com/news/?a=5100
If I link to a live asset in the media folder, the link looks like this: www.example.com/news/?a=51250 and not like the usual path http://www.example.com/__data/assets/pdf_file/etc….



any ideas? has anyone experienced this too? :unsure:

thanks.

[quote]I have noticed that any link in the body contents are not expanded and end up looking like this www.example.com/news/?a=5100
If I link to a live asset in the media folder, the link looks like this: www.example.com/news/?a=51250 and not like the usual path http://www.example.com/__data/assets/pdf_file/etc.



any ideas? has anyone experienced this too? :unsure:

thanks.[/quote]

I had this before.



What is the type for the asset which is linked from new item? If it’s a standard page, and you linked to its page contents instead of the standard page itself, this will happen.



Robin


Robin, it happens with any asset, eg pdf file, image, etc. Even if I link to the standard page itself, it won't take me to the actual page sitting in another part of the site - it will just load the standard page's contents within the news "page" using the news item's paint layout. hope that made sense!

It seems you need Squiz support if you still cannot get any ideas with the checklist below,

  1. design parse file
  2. paint layout (use "news items format" instead of "default formats" - "Custom Asset Types" in details screen)
  3. make sure that you didn't apply that paint layout all over the site



    Robin

What version of Matrix are you running? The News Item doesn't have proper bodycopy assets (it uses WYSIWYG attributes instead), so there was an issue with these attributes not doing full URL expansion at one stage. I thought this was fixed in one of the more recent versions, but I can't seem to find an entry in the Bug Tracker for it.

Avi, I'm running 3.16.3 but I remember seeing this on 3.12.3 too


It was definitely a problem in v3.12, but I thought it had been fixed in v3.16. Greg is away for a few days, so he'll have to check when he gets back next week.

I believe this is bug 2088: http://bugs.matrix.squiz.net/view_bug.php?bug_id=2088
Marked as fixed in 3.12.0. So if the ./?a=xxx style links are not being replaced, please submit a bug report.

[quote]I have noticed that any link in the body contents are not expanded and end up looking like this www.example.com/news/?a=5100
If I link to a live asset in the media folder, the link looks like this: www.example.com/news/?a=51250 and not like the usual path http://www.example.com/__data/assets/pdf_file/etc.



any ideas? has anyone experienced this too? :unsure:

thanks.[/quote]



sounds very similar to my post http://www.example.com/__data/assets/pdf_file/etc.


No, the mechanisms for expanding the URLs in this post and your post are different.

Sorry to bring up an old post…


I’ve followed Luke’s steps in this bug report, and I can get the internal links to expand correctly (just had to change %asset_contents% to %asset_attribute_body%).



Since this will only print the body, I have changed my paint layout to include keywords for the contact name and phone. But these print out the contents only and not the labels (Contact: & Phone:). I have typed the labels into the layout but this looks silly if a contact name/phone doesn’t exist.



It looks like I can get these labels to appear only if %asset_contents% is used … or have I missed something?


You can use Conditional Keywords in the Paint Layout to hide/show content based on whether an attribute has content. Using conditional keywords, you can make the Contact and Phone labels disappear when there is no Contact or Phone data. I don't have an example here at home, but I have one on a client install, which I can lookup tomorrow.

oh cool, thanks Avi. Could you point me to the right manual for setting up conditional keywords?

I'm not actually sure in which manual Paint Layouts are covered. As an example, if you configure the following Conditional Keyword on a News Item Format for a Paint Layout:

Condition Keyword Regexp
Keyword Name: has_contact
Keyword is true if: the following condition does not match the specified pattern
Options: Keyword: asset_attribute_contact_name
Pattern: ^$

Essentially, this says: If the asset_attribute_contact_name is NOT blank (i.e. does not match ^$) then the condition is true.

We can then use this in the News Item Format:

%begin_has_contact%
Contact: %asset_attribute_contact_name%
%end_has_contact%

So, the Paint Layout will only display that block of content if the "has_content" condition is true -- and the condition is only true if the attribute is NOT blank.

Hope that helps!

Avi, thanks again for the super fast reply!