[SOLVED]CGFeedMaker and News - about to give up......

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
applekeith
Forum Members
Forum Members
Posts: 23
Joined: Wed Jan 07, 2009 4:20 pm

Re: CGFeedMaker and News - about to give up......

Post by applekeith »

I removed the atom:link.

When I removed the

Code: Select all

number='8'
IE resonded with:
End tag 'channel' does not match the start tag 'div'.
Line: 859 Character: 9

     
My line in the news summary template actually read:

Code: Select all

{$pagetext} {$pagenumber} {$oftext} {$pagecount}
When I removed the

Code: Select all

 
IE responded with:
Reference to undefined entity 'nbsp'.
Line: 15 Character: 2

 > >>
So it got a bit further before crapping out. I am using the built in editor to make all changes.

Ok, now here is the kicker. I had commented out the atom:link line with

Code: Select all

{*...*}
just like all of the other comments in the template, and lo-and-behold...I have an RSS feed! FeedDemon does not like it,but Outlook2007 will take it (if you tell it to...).

Many thanks.
Keith Applegarth
applekeith
Forum Members
Forum Members
Posts: 23
Joined: Wed Jan 07, 2009 4:20 pm

Re: CGFeedMaker and News - about to give up......

Post by applekeith »

Follow up... I put everything back to the original configuration (except for the removal of the atom:link line).

If I take the

Code: Select all

{news assign='junk'}
and put

Code: Select all

number='10'
back in. So it looks like:

Code: Select all

 {news number='10' assign='junk'}
It breaks the feed with IE reporting:
Reference to undefined entity 'nbsp'.
Line: 14 Character: 6

Page 1 of 4
With the

Code: Select all

number='10'
removed...It works.

I am not sure exactly 'why', but it is working now. If you'd like me to try something else, let me know.

Many Thanks!
Keith Applegarth
zigge
Forum Members
Forum Members
Posts: 75
Joined: Tue Jan 22, 2008 6:53 pm

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by zigge »

I bet it has to do with your template for news where you have umlauts between the page parameters. Just a thouht, your site is runnning UTF-8?

Mats
applekeith
Forum Members
Forum Members
Posts: 23
Joined: Wed Jan 07, 2009 4:20 pm

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by applekeith »

I don't think so.
applekeith
Forum Members
Forum Members
Posts: 23
Joined: Wed Jan 07, 2009 4:20 pm

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by applekeith »

Nope. I am running en-iso-8859-1. However, as soon as I add the

Code: Select all

number='10'
I am back to getting errors. I removed it and my feed at least works. So, basically it is working. Just not exactly as I would like.

Keith
Last edited by applekeith on Sat Jan 10, 2009 8:22 pm, edited 1 time in total.
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by tyman00 »

Your feed still doesn't work without the number="10" removed. It's still doesn't validate. Look at the source of your feed. It isn't formatted properly. It is spitting out the news as text before it starts getting into the declaration.

I see:

Code: Select all

#     
#                <!-- Displaying News Module -->
# <!-- News Categories: '' -->
# <!-- Start News Display Template -->
#  <p>
# Page 1 of 5
#  <a href="http://akapplegarth.us/index.php?mact=News,m2,default,1&m2number=10&m2assign=junk&m2pagenumber=2&m2returnid=15&page=15">></a> <a href="http://akapplegarth.us/index.php?mact=News,m2,default,1&m2number=10&m2assign=junk&m2pagenumber=5&m2returnid=15&page=15">>></a>
# </p>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=53&cntnt01returnid=15">RSS Feed is Fixed!</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>The RSS Feed is now working.</p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=52&cntnt01returnid=15">240RevBot Started</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>Check out the <a href="http://akapplegarth.us/index.php?page=240revbot" title="240RevBot">project page</a>.</p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=51&cntnt01returnid=15">Website Update</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>Updated all CMS modules. RSS Feed is not working. Updated Blog.</p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=50&cntnt01returnid=15">Blog Update</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>Updated blog.</p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=49&cntnt01returnid=15">Lego Thumb Drive Finished!</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p><a href="index.php?page=lego-thumb-drive-project">Check it out here</a><a>!</a></p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=48&cntnt01returnid=15">Lil' Miller Bot is Done!</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>Finished the <a href="index.php?page=lil-miller">Lil' Miller Bot</a>. Added photos to the <a href="index.php?page=beam-robots">BEAM Gallery</a>.</p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=47&cntnt01returnid=15">New JingleBot Photos</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>Added photos to the <a href="index.php?page=beam-robots">BEAM Gallery</a>.</p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=46&cntnt01returnid=15">New JingleBot Finished!</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>It is done! <a href="index.php?page=new-jinglebot">Check it out here</a>!</p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=45&cntnt01returnid=15">New JingleBot Started!</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>New JingleBot has begun! <a href="index.php?page=new-jinglebot">See it here</a>!</p>
# </div>
#  
#  
#  
# </div>
# <div class="NewsSummary">
#  
#  
# <div class="NewsSummaryLink">
# <a href="http://akapplegarth.us/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=44&cntnt01returnid=15">LM3909Vore Finished!</a>
# </div>
#  
# <div class="NewsSummarySummary">
# <p>She LIVES! <a href="index.php?page=lm3909vore">See how it turned out</a>!</p>
# </div>
#  
#  
#  
# </div>
# <!-- End News Display Template -->
That should not be in the source of your feed. I suggest starting a whole new feed for news and using this template. Replace the entire default template with this.

Code: Select all

{* original rss feed template *}
<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>{$feed.title}</title>
    {if isset($feed.link) && !empty($feed.link)}<link>{$feed.link}</link>{/if}
    {if isset($feed.description) && !empty($feed.description)}<description>{$feed.description}</description>{/if}
    {if isset($feed.copyright) && !empty($feed.copyright)}<copyright>{$feed.copyright}</copyright>{/if}
    {if isset($generator)}<generator>{$generator}</generator>{/if}
    {if isset($feed.managing_editor) && !empty($feed.managing_editor)}<managingEditor>{$feed.managing_editor}</managingEditor>{/if}
    {if isset($admin_email)}<webMaster>{$admin_email} ({$admin_user->firstname} {$admin_user->lastname})</webMaster>{/if}
    {if isset($feed.image) && !empty($feed.image)}
      <image>
	{if isset($feed.description) && !empty($feed.description)}<description>{$feed.description}</description>{/if}
        {if isset($feed.link) && !empty($feed.link)}<link>{$feed.link}</link>{/if}
        <title>{$feed.title}</title>
        <url>{$file_location}/{$feed.image}</url>
      </image>
    {/if}

    {* an example of how to create a feed from a call to the news module *}
    {* you can use any smarty variable that is available in the news summary template *}
    {* you can substitute this logic with output from any module that supports a summary
       view, or possibly get artistic and mix output from different modules *}
    {news assign='junk'}
    {foreach from=$items item='entry'}
    <item>
      <title>{$entry->title}</title>
      <link>{$entry->moreurl}</link>
      <description>{if isset($entry->summary)}{$entry->summary|strip_tags|summarize:40}{else}{$entry->content|strip_tags|summarize:40}{/if}</description>
      <pubDate>{$entry->postdate|us_date_format:"%a, %d %b %Y %H:%M:%S %Z"}</pubDate>
      <guid>{$entry->moreurl}</guid>
    </item>
    {/foreach}
  </channel>
</rss>
If that works then try adding number='10' to your {news assign='junk'} call.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
iNSiPiD

Re: CGFeedMaker and News - about to give up......

Post by iNSiPiD »

I've just spent over 6 hours trying to clean up several hundred news entries on a client's site in an attempt to get their feed working, so my mood is not good right now. :)

This is not solved. It is bolloxed. It's also deeply frustrating that the previous RSS functionality within News used to just work adn people are having so many problems with the out of the box CGFeedmaker replacement.

Sorry, calguy. No offence intended but you simply haven't accounted for the sheer determination of moronic end users, who haven't a clue about standards, to paste as much evil sh!t as they want into WYSIWYG fields - irrespective of the settings, encoding or doctype.

The end result is a broken feed. I've informed my clients of the reason their ffed isn't displaying but they are understandably not happy, nor satisifed. Is there anything that can be done for this? What did the old RSS cleanup stuff in News do? Never had a problem with that.
Last edited by iNSiPiD on Sat Feb 28, 2009 9:59 am, edited 1 time in total.
iNSiPiD

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by iNSiPiD »

OK. I finally cracked this but the solution is not entirely supported by the spec.

Anyway, for those (like me) who just want their client's feeds to work, just wrap the propblem fields with CDATA tags.

i.e. title and description
applekeith
Forum Members
Forum Members
Posts: 23
Joined: Wed Jan 07, 2009 4:20 pm

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by applekeith »

Tyman00! You are my hero! Not only did that fixe it. It now displays the number as well.

Awesome, Many thanks!
Keith Applegarth
akapplegarth.us
iNSiPiD

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by iNSiPiD »

No worries, dude. Glad I could help.

I'm hoping calguy is following the post and will modify the template for future versions.

I supply a sample below with the fix, as well as the required Smarty tags to target a particular news category.

Code: Select all

{* an example of how to create a feed for the News module *}
    {news assign='junk'}
    {foreach from=$items item='entry'}
    {* Example of targeting a specific category of News -- remove if not required *}
    {if $entry->category == 'MyNewsCateory}
    <item>
      <title>{$entry->title|cms_htmlentities|strip_tags}</title>
      <link>{$entry->moreurl}</link>
      {capture assign='description'}{if isset($entry->summary)}{$entry->summary}{else}{$entry->content}{/if}{/capture}
      <description><![CDATA[{$description|trim|strip_tags|summarize:40}]]></description>
      <pubDate>{$entry->postdate|rfc_date}</pubDate>
      <guid>{$entry->moreurl}</guid>
    </item>
    {/if}{* Closing News category check - delete this too if not needed *}
    {/foreach}
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by tyman00 »

I am not sure wrapping CDATA tags in the default template is a good idea. It is a quick and dirty way to fix it and should only be used when needed, not as a default. The major problem here is valid RSS feeds rely on a specific Charset which is not very friendly for non-english characters. Personally I think the validity rules should be more forgiving, but this is what we have to work with.

applekieth - glad I could help. I forgot about this thread till insipid replied actually.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
applekeith
Forum Members
Forum Members
Posts: 23
Joined: Wed Jan 07, 2009 4:20 pm

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by applekeith »

Well, Thanks to you both. I now have it functioning as it should.

Many thanks again!
AppleKeith
iNSiPiD

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by iNSiPiD »

tyman00, I couldn't agree more. It's not a solution, rather a fix.

That being said, there is really nothing against wrapping volatile output with CDATA tags.

One of the problems actually lies with the News title input field. It is plain text and has a function that converts &s to &s at processing time. This means you just need to leave it alone and educate l-users.

The charset is another issue but in theory UTF-8 is pretty standard across the board.

What I can't get around is the damn atom link paramaters - href="{$feed_url}" rel="self".

The validators don't seem to get either, probably due to pretty URLs and/or custom rewrites.
moorezilla

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by moorezilla »

I have a question that is along the same lines, but I'll move it if it seems outside of this discussion.

I'm having an issue where "content" shows up fine in rss, but if there's a summary the "summary" is ignored. Here's an example feed: http://chs.chelseaschools.com/chs/feeds/CHS-News.rss

I'm using the following (with cdata) for an rss template now after this thread, but I had the same issue using the default.

Code: Select all

{* original rss feed template *}
<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>{$feed.title}</title>
    {if isset($feed.link) && !empty($feed.link)}<link>{$feed.link}</link>{/if}
    {if isset($feed.description) && !empty($feed.description)}<description>{$feed.description}</description>{/if}
    {if isset($feed.copyright) && !empty($feed.copyright)}<copyright>{$feed.copyright}</copyright>{/if}
    {if isset($generator)}<generator>{$generator}</generator>{/if}
    {if isset($feed.managing_editor) && !empty($feed.managing_editor)}<managingEditor>{$feed.managing_editor}</managingEditor>{/if}
    {if isset($admin_email)}<webMaster>{$admin_email}</webMaster>{/if}
    {if isset($feed.image) && !empty($feed.image)}
      <image>
	{if isset($feed.description) && !empty($feed.description)}<description>{$feed.description}</description>{/if}
        {if isset($feed.link) && !empty($feed.link)}<link>{$feed.link}</link>{/if}
        <title>{$feed.title}</title>
        <url>{$file_location}/{$feed.image}</url>
      </image>
    {/if}

{* an example of how to create a feed for the News module *}
    {news assign='junk'}
    {foreach from=$items item='entry'}
  
    <item>
      <title>{$entry->title|cms_htmlentities|strip_tags}</title>
      <link>{$entry->moreurl}</link>
      {capture assign='description'}{if isset($entry->summary)}{$entry->summary}{else}{$entry->content}{/if}{/capture}
      <description><![CDATA[{$description|trim|strip_tags|summarize:40}]]></description>
      <pubDate>{$entry->postdate|rfc_date}</pubDate>
      <guid>{$entry->moreurl}</guid>
    </item>
    {/foreach}
 </channel>
</rss>
Thanks for any help. No shocking specs:

linux
php 5.2.x
mysql 5.x
cmsms latest release
Calguy Feedmaker latest release
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: [SOLVED]CGFeedMaker and News - about to give up......

Post by tyman00 »

iNSiPiD wrote:   The validators don't seem to get either, probably due to pretty URLs and/or custom rewrites.

insipid: Yeah that atom feed area doesn't validate well if you do  not have pretty urls enabled.

tyman00 wrote:
When I "improved" the template to make the W3 validator happier, I was testing with Pretty URL's turned on. Apparently the ATOM link will not work if you do not have Pretty URL's turned on. Some of the characters in the URL's throw off the validator. You will need to delete that reference from your template if you do not intend to turn Pretty URL's on. The ATOM feed is not required, just recommended.
I never really thought validating a RSS feed would be so difficult because of the unforgiving rules.


moorezilla: I vaguely remember having that same issue. Let me pick my brain to see if I can remember what I did.
Last edited by tyman00 on Tue Mar 03, 2009 4:19 pm, edited 1 time in total.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Post Reply

Return to “Modules/Add-Ons”