|
|
|
|
erik kulvinskas
()
|
|
||||||||||||
|
Hey all,
I have been struggling with this for a while now. If you go to our beta test site at: http://ext.dot.state.co.us you will see that in the header, just below the logo is some static text. I would like to make that dynamic by simply, or 'simply', grabbing the description from a news article that exists in the content database. I have read many articles on this but have fallen short of successfully doing it. I have started over and would like a fresh view on this. I have read that i can access the description of a news article by following a particular path-ing mechanism but i can never get it to work. Could someone point me in the right direction here concerning how to do this? Thanks, -Erik |
||||||||||||||
|
|
erik kulvinskas
()
|
|
All, I was able to find a snippet of code that gets ALL of the text for the article. Any help trying to find out how to just get its description or title would be gratefuly appreciated. <tal:block tal:condition="exists:here/staging/newssection/overview.html"
tal:replace="structure here/staging/newssection/overview.html/getText"> |
||
|
|
vedaw
()
|
|
||||||||||||
|
Maybe this will help? It gives you a few ideas of things you could pull
in... Just make sure you grab the object first. <tal:loop repeat="item featured"> <div class="featured-item" tal:define="item_object item/getObject"> <a tal:attributes="href item_object/absolute_url;" tal:condition="exists:item_object/image_tile"> <img src="" alt="" tal:replace="structure python: path('nocall:item_object/tag')(scale='thumb', css_class='thumbImage')" /> </a> <h3 class="tileHeadline" metal:define-macro="listitem"> <a href="#" class="summary url" tal:attributes="href item_object/absolute_url" tal:content="item/pretty_title_or_id"> Item Title </a> </h3> <span class="hidden" tal:replace="python:toLocalizedTime(item.ModificationDate,long_format=1)"> August 16, 2001 at 23:35:59 </span> <p class="tileBody"> <span class="description" tal:content="item/Description"> description </span> </p> <span class="featuredClear"></span> </div> </tal:loop> On 4/14/09 12:54 PM, "erik kulvinskas" <[hidden email]> wrote: > > > Hey all, > > I have been struggling with this for a while now. If you go to our beta test > site at: http://ext.dot.state.co.us you will see that in the header, just > below the logo is some static text. I would like to make that dynamic by > simply, or 'simply', grabbing the description from a news article that exists > in the content database. I have read many articles on this but have fallen > short of successfully doing it. I have started over and would like a fresh > view on this. I have read that i can access the description of a news article > by following a particular path-ing mechanism but i can never get it to work. > Could someone point me in the right direction here concerning how to do this? > > Thanks, > > -Erik > > All, > > I was able to find a snippet of code that gets ALL of the text for the > article. Any help trying to find out how to just get its description or title > would be gratefuly appreciated. > <tal:block tal:condition="exists:here/staging/newssection/overview.html" > tal:replace="structure > here/staging/newssection/overview.html/getText"> _______________________________________________ UI mailing list [hidden email] http://lists.plone.org/mailman/listinfo/ui |
||||||||||||||
|
|
erik kulvinskas
()
|
|
|||||||||||
|
Thanks Veda! i ended up using the following:
<tal:block tal:condition="exists:here/staging/newssection/overview.html" tal:replace="structure here/staging/newssection/overview.html/Description"> Document content here</tal:block> and it works great! -ERik On Tue, Apr 14, 2009 at 2:01 PM, vedaw (via Nabble) <[hidden email]> wrote: > Maybe this will help? It gives you a few ideas of things you could pull > in... Just make sure you grab the object first. > > <tal:loop repeat="item featured"> > <div class="featured-item" > tal:define="item_object item/getObject"> > > <a tal:attributes="href item_object/absolute_url;" > tal:condition="exists:item_object/image_tile"> > <img src="" alt="" > tal:replace="structure python: > path('nocall:item_object/tag')(scale='thumb', css_class='thumbImage')" /> > </a> > > <h3 class="tileHeadline" > metal:define-macro="listitem"> > <a href="#" > class="summary url" > tal:attributes="href > item_object/absolute_url" > tal:content="item/pretty_title_or_id"> > Item Title > </a> > </h3> > > > <span class="hidden" > tal:replace="python:toLocalizedTime(item.ModificationDate,long_format=1)"> > August 16, 2001 at 23:35:59 > </span> > <p class="tileBody"> > <span class="description" > tal:content="item/Description"> > description > </span> > </p> > > <span class="featuredClear"></span> > > </div> > </tal:loop> > > > On 4/14/09 12:54 PM, "erik kulvinskas" <vaporboy@...> wrote: > >> >> >> Hey all, >> >> I have been struggling with this for a while now. If you go to our beta >> test >> site at: http://ext.dot.state.co.us you will see that in the header, just >> below the logo is some static text. I would like to make that dynamic by >> simply, or 'simply', grabbing the description from a news article that >> exists >> in the content database. I have read many articles on this but have fallen >> short of successfully doing it. I have started over and would like a fresh >> view on this. I have read that i can access the description of a news >> article >> by following a particular path-ing mechanism but i can never get it to >> work. >> Could someone point me in the right direction here concerning how to do >> this? >> >> Thanks, >> >> -Erik >> >> All, >> >> I was able to find a snippet of code that gets ALL of the text for the >> article. Any help trying to find out how to just get its description or >> title >> would be gratefuly appreciated. >> <tal:block tal:condition="exists:here/staging/newssection/overview.html" >> tal:replace="structure >> here/staging/newssection/overview.html/getText"> > > _______________________________________________ > UI mailing list > UI@... > http://lists.plone.org/mailman/listinfo/ui > > > ________________________________ > This email is a reply to your post @ > http://n2.nabble.com/Grabbing-an-article-title-or-description-out-of-context.-tp2633284p2635057.html > You can reply by email or by visting the link above. > > |
|||||||||||||
|
|
Ricardo Newbery-2
()
|
|
||||||||||||
|
Careful. You are using the 'structure' keyword on a field that is not being filtered for bad html. This could be a problem if non-trusted folks can edit that field. The convention is that html is not used in the 'Description' field so you can usually omit the structure keyword. Ric On Apr 14, 2009, at 2:53 PM, erik kulvinskas wrote: > Thanks Veda! i ended up using the following: > > <tal:block tal:condition="exists:here/staging/newssection/ > overview.html" > tal:replace="structure > here/staging/newssection/overview.html/Description"> > Document content here</tal:block> > > and it works great! > > -ERik > > On Tue, Apr 14, 2009 at 2:01 PM, vedaw (via Nabble) > <ml-user+36195-1628119807@...> wrote: > > > Maybe this will help? It gives you a few ideas of things you could > pull > > in... Just make sure you grab the object first. > > > > <tal:loop repeat="item featured"> > > <div class="featured-item" > > tal:define="item_object item/getObject"> > > > > <a tal:attributes="href item_object/ > absolute_url;" > > tal:condition="exists:item_object/image_tile"> > > <img src="" alt="" > > tal:replace="structure python: > > path('nocall:item_object/tag')(scale='thumb', > css_class='thumbImage')" /> > > </a> > > > > <h3 class="tileHeadline" > > metal:define-macro="listitem"> > > <a href="#" > > class="summary url" > > tal:attributes="href > > item_object/absolute_url" > > tal:content="item/ > pretty_title_or_id"> > > Item Title > > </a> > > </h3> > > > > > > <span class="hidden" > > > tal:replace > ="python:toLocalizedTime(item.ModificationDate,long_format=1)"> > > August 16, 2001 at 23:35:59 > > </span> > > <p class="tileBody"> > > <span class="description" > > tal:content="item/Description"> > > description > > </span> > > </p> > > > > <span class="featuredClear"></span> > > > > </div> > > </tal:loop> > > > > > > On 4/14/09 12:54 PM, "erik kulvinskas" <vaporboy@...> wrote: > > > >> > >> > >> Hey all, > >> > >> I have been struggling with this for a while now. If you go to > our beta > >> test > >> site at: http://ext.dot.state.co.us you will see that in the > header, just > >> below the logo is some static text. I would like to make that > dynamic by > >> simply, or 'simply', grabbing the description from a news article > that > >> exists > >> in the content database. I have read many articles on this but > have fallen > >> short of successfully doing it. I have started over and would > like a fresh > >> view on this. I have read that i can access the description of a > news > >> article > >> by following a particular path-ing mechanism but i can never get > it to > >> work. > >> Could someone point me in the right direction here concerning how > to do > >> this? > >> > >> Thanks, > >> > >> -Erik > >> > >> All, > >> > >> I was able to find a snippet of code that gets ALL of the text > for the > >> article. Any help trying to find out how to just get its > description or > >> title > >> would be gratefuly appreciated. > >> <tal:block tal:condition="exists:here/staging/newssection/ > overview.html" > >> tal:replace="structure > >> here/staging/newssection/overview.html/getText"> > > > > _______________________________________________ > > UI mailing list > > UI@... > > http://lists.plone.org/mailman/listinfo/ui > > > > > > ________________________________ > > This email is a reply to your post @ > > http://n2.nabble.com/Grabbing-an-article-title-or-description-out-of-context.-tp2633284p2635057.html > > You can reply by email or by visting the link above. > > > > > > View this message in context: Re: [Plone-UI] Grabbing an article > title or description out of context. > Sent from the User Interface & Design mailing list archive at > Nabble.com. > _______________________________________________ > UI mailing list > [hidden email] > http://lists.plone.org/mailman/listinfo/ui _______________________________________________ UI mailing list [hidden email] http://lists.plone.org/mailman/listinfo/ui |
||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |