Custom Field in RSS

More
13 years 1 month ago #19910 by igcorreia
Consider the option to add custom field to the RSS FEED,something like the custom fields in the modules.

The problem is that or:
I have the image in the desciption and in does not show separetly in the RSS FEED
or:
I put the image in a IMAGE FIELD and it does not show in the FEED
:/

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #20518 by igcorreia
Replied by igcorreia on topic Custom Field in RSS
I have been trying for the last days to add a image field to the Rss.

Could anyone help me?

I'd like to add something like this:

if($fieldcalled -> image){
add to the rss: <image>...</image>
}else{
do not show
}

I have found a view.rss.php but I cant figure this one out. Is this a complex request? Thanks in adnvace.

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #20591 by igcorreia
Replied by igcorreia on topic Custom Field in RSS
Hello,
this is the one:
www.designemportugal.com/index.php?format=feed&type=rss

Yes that exacly it:
[attachment=0:1fln55ja]<!-- ia0 -->image-rss.PNG<!-- ia0 -->[/attachment:1fln55ja]

If there is a code for one custom field, then it is very easy to copy paste to make more. The problem is that I dont know how to make even one :D :/

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #20629 by igcorreia
Replied by igcorreia on topic Custom Field in RSS
This is an interesting aricle to valide the data:
www.bobulous.org.uk/coding/php-xml-feeds.html

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #21623 by ggppdk
Replied by ggppdk on topic Custom Field in RSS
Edit your components/com_flexicontent/views/category view.feed.php
add after:
$doc = & JFactory::getDocument();
Code:
//*************** BOF *************************// require_once(JPATH_SITE.DS."components/com_flexicontent/classes/flexicontent.helper.php"); require_once(JPATH_SITE.DS."components/com_flexicontent/models/items.php"); //*************** EOF *************************//

add after:
$item->description = $description;
Code:
//*************** BOF *************************// // 1. Load item data JRequest::setVar('id', $row->id); $itemmodel = new FlexicontentModelItems(); $fcitem = $itemmodel->getItem(); $item_link = JRoute::_(FlexicontentHelperRoute::getItemRoute($fcitem->slug, $fcitem->categoryslug)); FlexicontentFields::getFields(array($fcitem)); // 2.a Get value and label of fields // field named 'imageG' $imageG = FlexicontentFields::getFieldDisplay($fcitem, 'imageG'); $imageG_label = $fcitem->onDemandFields['imageG']->label; // field named 'field15' $field15 = FlexicontentFields::getFieldDisplay($fcitem, 'field15'); $field15_label = $fcitem->onDemandFields['field15']->label; // 3. replace < and > with &lt; and &gt; // field named 'imageG' $ImageG= str_replace("<","&lt;",$ImageG); $ImageG= str_replace(">","&gt;",$ImageG); // field named 'field15' $field15= str_replace("<","&lt;",$field15); $field15= str_replace(">","&gt;",$field15); // 4. Put the fields inside variable that will be printed inside RSS <description> if (!$fcitem->onDemandFields['imageG']->noaccess) { $item->description .= "&lt;b&gt;".$imageG_label."&lt;/b&gt;: ".$imageG."&lt;br /&gt;"; } if (!$fcitem->onDemandFields['field15']->noaccess) { $item->description .= "&lt;b&gt;".$field15_label."&lt;b&gt;: ". $field15."&lt;br /&gt;"; } //*************** EOF *************************//

As you can see above you need to encode html < and > as &lt; and &gt; and also you should include fields inside RSS <description> , that is why we append everything to $item->description , because it is printed inside RSS <description>

Please note that the fields may not have styling:
You could try this to include css files:
mondaybynoon.com/2006/08/14/begi ... -rss-feed/
i am not sure this will work (i mean the css files)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #21625 by micker
Replied by micker on topic Custom Field in RSS
i do an error my field is imageg i adapt it
Code:
//*************** BOF *************************// // 1. Load item data JRequest::setVar('id', $row->id); $itemmodel = new FlexicontentModelItems(); $fcitem = $itemmodel->getItem(); $item_link = JRoute::_(FlexicontentHelperRoute::getItemRoute($fcitem->slug, $fcitem->categoryslug)); FlexicontentFields::getFields(array($fcitem)); // 2.a Get value and label of fields // field named 'imageg' $imageg = FlexicontentFields::getFieldDisplay($fcitem, 'imageg'); $imageg_label = $fcitem->onDemandFields['imageg']->label; // field named 'field15' $field15 = FlexicontentFields::getFieldDisplay($fcitem, 'field15'); $field15_label = $fcitem->onDemandFields['field15']->label; // 3. replace < and > with &lt; and &gt; // field named 'imageG' $imageg= str_replace("<","&lt;",$imageg); $imageg= str_replace(">","&gt;",$imageg); // field named 'field15' $field15= str_replace("<","&lt;",$field15); $field15= str_replace(">","&gt;",$field15); // 4. Put the fields inside variable that will be printed inside RSS <description> if (!$fcitem->onDemandFields['imageg']->noaccess) { $item->description .= "&lt;b&gt;".$imageg_label."&lt;/b&gt;: ".$imageg."&lt;br /&gt;"; } if (!$fcitem->onDemandFields['field15']->noaccess) { $item->description .= "&lt;b&gt;".$field15_label."&lt;b&gt;: ". $field15."&lt;br /&gt;"; } //*************** EOF *************************//
but blank page

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.392 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline