Add images to rss when image is not inside $entry.body
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Add images to rss when image is not inside $entry.body
I have a template that is using extended property fields for images, rather than having the images contained within the entry body. How can these images be included in the feed?
=Don=
Re: Add images to rss when image is not inside $entry.body
Disclaimer: This is untested, I have never used it myself, and I don't have approriate knowledge of xml and/or RSS to back it up. Maybe this doesn't conform to xml and/or RSS standards.Don Chambers wrote:I have a template that is using extended property fields for images, rather than having the images contained within the entry body. How can these images be included in the feed?
I guess you have looked into /templates/default/ before. Ever examined those feed_*.tpl files closer? They're just like "normal" .tpl files, but instead of PHP/(X)HTML for parts of the blog, they provide XML for the feed, and you can of course use smarty in them, which means you can include images from extended property fields.
I guess you can take it from here? Might be nice to post a working code example later for future reference, though. You'll probably also want to check out if there are any XML and/or RSS standards blocking this, but I can figure out why there should be any.
YL
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
I know the tpl files are there... but I was hoping for an alternative. Those tpls check to see if $entry.body is not empty, and if not, it then prints {$entry.feed_body|@escape}.... so at some point, $entry.feed_body is created and contains not only the image, but all the proper formatting for that image.... probably because formatting is performed inline by the media manager when an image is inserted into an entry.
Not sure exactly what I was thinking... maybe something like the ability to define the $entry.feed_body to be all content wrapped within a certain class or something. But that probably would not work because the feed is independent of entries.tpl.
Not sure exactly what I was thinking... maybe something like the ability to define the $entry.feed_body to be all content wrapped within a certain class or something. But that probably would not work because the feed is independent of entries.tpl.
=Don=
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
You can basically use the same coding than within your entries.tpl file, simply append your custom stuff into the place where $feed_Body already goes into, simply add more to that XML element.
Only you need tomake sure that "<" and ">" are escaped to > and <so that they can be usedwithin XML.
Regards,
Garvin
You can basically use the same coding than within your entries.tpl file, simply append your custom stuff into the place where $feed_Body already goes into, simply add more to that XML element.
Only you need tomake sure that "<" and ">" are escaped to > and <so that they can be usedwithin XML.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Am I missing something here? I copied the file feed_2.0.tpl to my template, modified it, but the changes are not being reflected in my rss2 feed. I have also cleared /templates_c/. Am I working with the wrong file?
UPDATE: Seems to have been firefox.... the file was being cached, and for whatever reason, firefox didn't seem to see any need to load the modified file.
This experience did lead me to a nice firefox add-on for viewing the cache:
https://addons.mozilla.org/en-US/firefox/addon/2489
UPDATE: Seems to have been firefox.... the file was being cached, and for whatever reason, firefox didn't seem to see any need to load the modified file.
This experience did lead me to a nice firefox add-on for viewing the cache:
https://addons.mozilla.org/en-US/firefox/addon/2489
=Don=
-
mgroeninger
- Regular
- Posts: 546
- Joined: Mon Dec 20, 2004 11:57 pm
- Contact:
Doh, completely got confused there and posted a big old long message about something else entirely...
Sorry about that.
Sorry about that.
Matthew (Feeling generous?)
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Absolutely correct, yes.
Regards,
Garvin
Absolutely correct, yes.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/