Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Article Manager 2:
Accessing ***image1*** from RSS template

 

 


joelozito
User

Jul 3, 2008, 10:35 AM

Post #1 of 7 (730 views)
Shortcut
Accessing ***image1*** from RSS template Can't Post

Hi all,

I'm trying to access the ***image1*** field in order to have an image show up in my RSS feed. Currently, ***image1*** is only used in my content field, not my summary field. And since I only want summary to appear in the RSS feed, image1 doesn't show up.

For example, I have the following line in the RSS template:

<description>$article.summary:htmlEncoded$</description>

I'd want to do something like:

<description>***image1***$article.summary:htmlEncoded$</description>

Is there anyway to access the data that's in ***image1*** from an RSS template?

Thanks,

Joe


Donna
Staff / Moderator


Jul 3, 2008, 11:26 AM

Post #2 of 7 (727 views)
Shortcut
Re: [joelozito] Accessing ***image1*** from RSS template [In reply to] Can't Post

Hi Joe,

The ***imageX*** placeholder only works in specific fields, so you can't put that on the template directly.

There's two ways you could do this:

- First would be to have a specific field for the RSS summary, where you could tweak it to look the way you want, including the image. Then switch the placeholder in your RSS template to use this field.

- Second would be to use the placeholder for the image field in your RSS template. The downside to this is that if you have more than one image, it's going to put them all in, not just "image 1".

Let me know if either of those methods work for you. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


joelozito
User

Jul 3, 2008, 1:40 PM

Post #3 of 7 (722 views)
Shortcut
Re: [Donna] Accessing ***image1*** from RSS template [In reply to] Can't Post

Hi Donna, thanks for the quick reply!

I had guessed that the first method would be an option, that's probably what I'll do. But I'm not sure I understand the second method. Could you clarify that a bit?

Thanks,
Joe


Donna
Staff / Moderator


Jul 3, 2008, 2:05 PM

Post #4 of 7 (721 views)
Shortcut
Re: [joelozito] Accessing ***image1*** from RSS template [In reply to] Can't Post

Hi Joe!

Every field in Article Manager can be expressed on the templates with the $article.fieldname$ placeholder. For example, take a look at this tutorial:

http://interactivetools.com/docs/doc.cgi?/articlemanager2/tutorials/summaryImages.html

This goes over how to create a single image upload field that then gets placed in a specific spot... but if you apply the same idea to your existing upload field, it'll work. Alternately, you could follow the tutorial exactly and add an RSS-only image upload field.

I hope this helps. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


joelozito
User

Jul 8, 2008, 7:55 AM

Post #5 of 7 (655 views)
Shortcut
Re: [Donna] Accessing ***image1*** from RSS template [In reply to] Can't Post

Hi Donna,

I gave this a shot using the tutorial, but I'm encountering an issue. I'm hoping you can help.

Basicaly, I had the following in my RSS feed template:

<!-- template insert : $articleList$ -->
<!-- templatecell : articleRow -->
<item>
<title>$article.title:textOnly:htmlEncoded$</title>
<link>$published.articlePage.url$</link>
<category>$category.name:textOnly:htmlEncoded$</category>
<description>$article.summary:htmlEncoded$</description>
<pubDate>$article.date:format(www, dd MMM yyyy HH:mm:ss)$ PST</pubDate>
<guid isPermaLink="true">$published.articlePage.url$</guid>
</item>
<!-- /templatecell : articleRow -->

In tried to insert the image as $article.image$ in the <description> node like this:
<description>$article.image$$article.summary:htmlEncoded$</description>

But I got the error: [$article.image requires a templateCell called 'article.image.row' in 'articleLists/moviesRSS.xml']

So I tried to use the following:
<description>
<!-- templatecell : article.image.row -->
$article.image$
<!-- /templatecell : article.image.row -->
$article.summary:htmlEncoded$</description>

But that didn't show anything in the resulting RSS file.

Any ideas?
Thanks,
Joe


Donna
Staff / Moderator


Jul 8, 2008, 9:55 AM

Post #6 of 7 (651 views)
Shortcut
Re: [joelozito] Accessing ***image1*** from RSS template [In reply to] Can't Post

Hi Joe,

You do need this part:


<!-- templatecell : article.image.row -->
$article.image$
<!-- /templatecell : article.image.row -->

...except it should have the full image code in it, like this:


<!-- templatecell : article.image.row -->
<img src="$file.webUrl$" width="$file.width$" align="$file.align$">
<!-- /templateCell : article.summaryImage.row -->

This doesn't need it's own <description> tag, or anything like that -- you can even just toss that down at the bottom of the file, as it's just telling Article Manager what code to use when you put the $article.image$ placeholder somewhere else. So, put the code I mentioned in any old place, then add the "$article.image$" placeholder into your <description> field with the $article.summary:htmlEncoded$ tag, and you're good to go. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


joelozito
User

Jul 8, 2008, 10:27 AM

Post #7 of 7 (646 views)
Shortcut
Re: [Donna] Accessing ***image1*** from RSS template [In reply to] Can't Post

Thanks Donna, works like a champ!

Just to recap, for those who need to do this:

My description tag ended up being:
<description><![CDATA[
$article.image$$article.summary$
]]></description>

Then at the bottom of the template (under the "/templatecell : articlerow" line), I put:
<!-- templatecell : article.image.row -->
<img src="$file.webUrl$" width="$file.width$" align="$file.align$">
<!-- /templatecell : article.image.row -->

Note, I added the "CDATA" code since HTML syntax now shows up in the description field.

Thanks again!
Joe

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4