ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Exclude {title} ?

August 03, 2011 10:22am

Subscribe [2]
  • #1 / Aug 03, 2011 10:22am

    DorinV

    38 posts

    Hi,

    I have a problem importing .rss/atom feed in EE.

    My code in template is:

    {exp:channel:entries channel="blog" limit="3" dynamic="on" category="{category_id}" }
    {exp:ajw_feedparser url="http://{blog_rss}" itempath="/feed/entry" cache_refresh="60" limit="1"}
    
    <li>
       <h3><a href="http://{title_permalink=">{title}</a></h3>
    <p>   <time datetime="2011-01-20T06:20:00-00:00">{published format="%l, %j %F %Y at %G:%i"}</time><br />
       {channel_description}<br />
       <a href="http://{author/uri}">{author/name}</a><br />
    </li></p>
    
    <p>{/exp:ajw_feedparser}                     <br />
    {/exp:channel:entries}

    My problem is that the {title} is used by both EE and AJW feed parser and I have to get rid of the EE {title} somehow but still keep the {exp:channel:entries} because the client is adding RSS feeds from EE back-end.

    Thank’s !

  • #2 / Aug 03, 2011 10:41pm

    Lisa Wess

    20502 posts

    Hi, DV -

    Yes, this is going to be a variable conflict.  The only way around that is to embed your inner tag so that it is parsed separately.  I’m not quite sure why you have them nested here either.  That could end up being a pretty heavy processing template right there.

  • #3 / Aug 04, 2011 1:45am

    DorinV

    38 posts

    Hi Lisa,

    Thanks for your reply.
    Maybe there is another way of doing this but for now this is the only way I know how to do.

    The URL is: http://bit.ly/pdmnAD
    The complete code:

    {exp:channel:categories channel="blog" style="linear" show_empty="no" parent_only="yes"}          
      <section class="articles section">                    
        <header>
          <h2>{category_name}</h2>
    <p>      <a href="http://{path=blog/blog_list}class=more">More</a><br />
        </header></p>
    
    <p><ul class="bblogs">     <br />
    {exp:channel:entries channel="blog" limit="3" dynamic="on" category="{category_id}" }<br />
    {exp:ajw_feedparser url="http://{blog_rss}" itempath="/feed/entry" cache_refresh="60" limit="1"}  </p>
    
    <p><li><br />
      </p><h3><a href="http://{title_permalink=">{title}</a></h3>
    <p>  <time datetime="2011-01-20T06:20:00-00:00">{published format="%l, %j %F %Y at %G:%i"}</time><br />
      <a href="http://{author/uri}">{author/name}</a><br />
    </li></p>
    
    <p>{/exp:ajw_feedparser}                  <br />
    {/exp:channel:entries} <br />
    </ul><br />
    </section><br />
    {/exp:channel:categories}

    I tried embedding the ajw feedparser with {embed="blog/feeds"} but it didn’t work (see: http://bit.ly/rpGTvl )

    It’s the same code I used for “news”, “food”, “events”, “about us”.

    Thank you !

  • #4 / Aug 04, 2011 12:30pm

    Lisa Wess

    20502 posts

    That is an absolute ton of nesting, and I do worry very much that is going to be a very heavy template.  You have to loop all of the inner tags for each of their outer tags recursively.  So you end up processing quite a lot.

    “it didn’t work” isn’t helpful even with the link in this case, because I don’t know what the content *should* look like.  But does that ajw_feedparser tag work on its own?

  • #5 / Aug 04, 2011 2:59pm

    DorinV

    38 posts

    The ajw_feeparser is RSS parser. He’s taking a feed (eg: http://rss1.smashingmagazine.com/feed/) and is populating the tags {title}, {published}, {author/uri}, etc. with the latest news/blogposts

    {blog_rss} is the name of the channel field where the client will paste the RSS feed in order to add a new “blogger”.

    The link to ajw_feedparser is: http://devot-ee.com/add-ons/feed-parser/

    Regarding the nesting, is there another way of doing it? Is it better to use div’s ?
    I need those lists because here (eg: http://bit.ly/pDh2ln) I have all the categories of the “food” channel listed. When the client will add a new category a new section will pop in(content area, side menu, breadcrumbs).

    Thank you for your help.

  • #6 / Aug 04, 2011 3:43pm

    Lisa Wess

    20502 posts

    Ahh, I see.  So you are embedding so that you can have per entry RSS feeds.

    What you may need to do is embed the feed parser tags and pass the custom field to that template, so that you don’t have this title variable conflict. 

    Make sense?

  • #7 / Aug 04, 2011 4:01pm

    DorinV

    38 posts

    Yep,

    I’ll try and see how’s going.

    Thank you Lisa !

  • #8 / Aug 04, 2011 5:45pm

    Lisa Wess

    20502 posts

    My pleasure, DV!  Let us know how you get along.

  • #9 / Aug 05, 2011 3:51pm

    DorinV

    38 posts

    I’m afraid this method is not working.

    Here’s my code:

    {exp:channel:entries channel="blog" limit="3" dynamic="on" category="{category_id}" }
    {embed="blog/feeds"}            
    {/exp:channel:entries}

    and the feeds template:

    {exp:ajw_feedparser url="http://{blog_rss}" itempath="/feed/entry" cache_refresh="60" limit="1"}  
     <li>
      <h3><a href="http://{title_permalink=">{title}</a></h3>
    <p>  <time datetime="2011-01-20T06:20:00-00:00">{published format="%l, %j %F %Y at %G:%i"}</time><br />
      <a href="http://{author/uri}">{author/name}</a><br />
     </li><br />
    {/exp:ajw_feedparser}

    ... or am I doing something wrong?

    Thank you !

  • #10 / Aug 05, 2011 3:55pm

    Lisa Wess

    20502 posts

    DorinV - the URL to the feed is in a custom field, right? So you’ll need to pass that custom field to your embed.

    {exp:channel:entries channel="blog" limit="3" dynamic="on" category="{category_id}" }
    {embed="blog/feeds" my_rss="{custom_field}"}            
    {/exp:channel:entries}

    Then put {embed:my_rss} where you would call the URL in the feed parser plugin.

    Make sense?

  • #11 / Aug 16, 2011 1:06pm

    DorinV

    38 posts

    Hi Lisa,

    Thanks for your help and sorry for the delay.
    I’m afraid it’s still not working:

    {exp:channel:entries channel="blog" limit="3" dynamic="on" category="{category_id}" }
    {embed="blog/feeds" my_rss="{title}"} 
    {/exp:channel:entries}

    and the file blog/feeds

    {exp:ajw_feedparser url="http://{blog_rss}" itempath="/feed/entry" cache_refresh="60" limit="1" }  
     <li>
       <h3><a href="http://{title_permalink=">{embed:my_rss}</a></h3>
    <p>   <time datetime="2011-01-20T06:20:00-00:00">{published format="%l, %j %F %Y at %G:%i"}</time><br />
        <a href="http://{author/uri}">{author/name}</a><br />
      </li><br />
    {/exp:ajw_feedparser}

    Maybe is a bug in the AJW feed parser. There must be another feed parser out there that I don’t know about ...

  • #12 / Aug 16, 2011 1:10pm

    Lisa Wess

    20502 posts

    There is nowhere in your blog/feeds parser that you’re calling {embed:my_rss}, that I can see, so it’s not seeing the information from your calling template.

  • #13 / Aug 16, 2011 1:20pm

    DorinV

    38 posts

    It’s working now !
    I placed the {embed:my_rss} in the wrong place. Now I understand how it works.

    Thanks a lot Lisa !  😉

  • #14 / Aug 16, 2011 1:23pm

    Sue Crocker

    26054 posts

    Glad Lisa was able to assist. If anything else comes up, please do let us know in a new thread..

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases