wrap article summary list template

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

wrap article summary list template

Post by isac »

How to wrap Article List entries?

I have this simple main template:

Code: Select all

<!-- main start //-->
    {CONTENT}
<!-- main end //-->
Article list render like this: simplified for demonstration purpose the articlesummary list template only have a div inside!

Code: Select all

<!-- main start //-->
    <div>entry 1</div>
    <div>entry 2</div>
    <div>entry 3</div>
<!-- main end //-->
I want this:

Code: Select all

<!-- main start //-->
    <div class="whatever">
        <div>entry 1</div>
        <div>entry 2</div>
       <div>entry 3</div>
    </div>
<!-- main end //-->
but not this, because don't need class "whatever" in full article display

Code: Select all

<!-- main start //-->
    <div class="whatever">
       {CONTENT}
    </div>
<!-- main end //-->
POR :D TUGAL
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: wrap article summary list template

Post by flip-flop »

If there is a specified category you can do it in this way:

in site template e.g. cat-id = 2:

Code: Select all

          [PHP]if ($GLOBALS['content']['cat_id'] == 2) echo '<div class="whow">';[/PHP]
          {CONTENT}
          [PHP]if ($GLOBALS['content']['cat_id'] == 2) echo '</div>';[/PHP]
An oher solutions is a frontend_render script triggering the begin and end of articles.

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Re: wrap article summary list template

Post by isac »

Yes, it work! Thank you.

But could be developed something like this:

Code: Select all

<!--ARTICLELIST_HEAD_START//-->
<div class="whow">
<!--ARTICLELIST_HEAD_END//-->

.
.
.
.


<!--ARTICLELIST_FOOTER_START//-->
</div>
<!--ARTICLELIST_FOOTER_END//-->
Same way teaser work.
POR :D TUGAL
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Re: wrap article summary list template

Post by isac »

It works, but it's not what I want.

I want "whow" only appears in article list category level and not when go to the full article.
POR :D TUGAL
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: wrap article summary list template

Post by flip-flop »

Two solutions:

1. make a issue http://code.google.com/p/phpwcms/issues/list
2. or write an frontend_render_script

article-list template Tags e.g.:

Code: Select all

<!-- ARTICLEX_ENTRY//-->
<div>
....
....
</div>
<!-- ARTICLEX_END//-->
[EDIT]
Replace the first <!-- ARTICLEX_ENTRY//--> to <div class="whow">
Replace the last <!-- ARTICLEX_END//--> to </div>
[/EDIT]

Result:

Code: Select all

<div class="whow">
....
<!-- ARTICLEX_END//-->
....
<!-- ARTICLEX_ENTRY//-->
....
<!-- ARTICLEX_END//-->

<!-- ARTICLEX_ENTRY//-->
....
</div> 
- voila, thats all. easy, fast and short.

phpwcms is a very very powerful machine.

(In the minimum case we need two lines code).

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: wrap article summary list template

Post by Oliver Georgi »

Wrap your content the global way and use CSS. Forget frontend_render and also forget the issue.

Code: Select all

<div id="outer">
{CONTENT}
</div>

Code: Select all

<div id="outer">
    <div class="list-item">entry 1</div>
    <div class="list-item">entry 2</div>
    <div class="list-item">entry 3</div>
</div>

Code: Select all

#outer .list-item { /* whatever */ }
A general content will not have such inner div.

And by the way phpwcms has list-mode tags.

Code: Select all

<!--IF_LIST_MODE_START//--><div class="list-items"><!--IF_LIST_MODE_END//-->
<!--ELSE_LIST_MODE_START//--><div class="full-article"><!--ELSE_LIST_MODE_END//-->
{CONTENT}
<!--ELSE_LIST_MODE_START//--></div><!--ELSE_LIST_MODE_END//-->
<!--IF_LIST_MODE_START//--></div><!--IF_LIST_MODE_END//-->
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Re: wrap article summary list template

Post by isac »

Please be patient because :)


This is my custom template (from template main block)

Code: Select all

<div id="header"></div>
<div id="content" class="containers_12">
  <!---->
  {CONTENT}
  <!---->
</div>
<div id="footer">
  <div id="foot" class="containers_12">
    <div class="grids_9">
      <!---->
      {NAV_LIST_UL:P,0}
      <!---->
    </div>
    <div class="grids_3">
      <ul>
        <li>Lorem Ipsum</li>
        <li>All Rights Reserved © 2010</li>
      </ul>
    </div>
    <div class="clear">&nbsp;</div>
  </div>
</div>


This one is the article list template (more them one article in category view)

Code: Select all

<!--template/inc_cntpart/articlesummary/list/projects_lists.tmpl-->

  <!-- [ARTICLEID]{ARTICLEID}[/ARTICLEID]-->
    [BEFORE]<!--BEFORE-->[/BEFORE]
    [AFTER]<!--AFTER-->[/AFTER]
      [SUB]<div class="projectItem grid_3">
        <div class="projectText cor"[CAPTION] style="background-color:{CAPTION}"[/CAPTION]> <span class="projectClient">{SUB}</span>[/SUB]
          [TITLE]<h3>{TITLE}</h3>[/TITLE]
          [SUMMARY]{SUMMARY}[/SUMMARY]
          [MORE]<a href="{ARTICLELINK}" class="moreLink">view case</a>[/MORE]</div>
        [IMAGE]<div class="projectTeaser"><a href="{ARTICLELINK}">{IMAGE}</a>[SUB]<span class="projectClient"> {SUB} </span>[/SUB]
          [TITLE]<h3>{TITLE}</h3>[/TITLE]
        </div>
      </div>[/IMAGE]



This one is the article template

Code: Select all

<!--template/inc_cntpart/articlesummary/article/projects_single.tmpl-->
<div class="projectSingle">[TITLE]
  <h3 class="grids_12">{TITLE}</h3>
  [/TITLE]{SLIDESHOW}
</div>
<div class="clear" style="padding-top: 25px;">&nbsp;</div>

I want the page list article like this:

Code: Select all

<div id="header"></div>
<div id="content" class="containers_12">
  <!---->
]<div id="project_list">
  <div id="gridView" class="gridView">[/b][/color]
<!--template/inc_cntpart/articlesummary/list/projects_lists.tmpl-->

    <!-- [ARTICLEID]{ARTICLEID}[/ARTICLEID]-->
    [BEFORE]<!--BEFORE-->[/BEFORE]
    [AFTER]<!--AFTER-->[/AFTER]
      [SUB]<div class="projectItem grid_3">
        <div class="projectText cor"[CAPTION] style="background-color:{CAPTION}"[/CAPTION]> <span class="projectClient">{SUB}</span>[/SUB]
          [TITLE]<h3>{TITLE}</h3>[/TITLE]
          [SUMMARY]{SUMMARY}[/SUMMARY]
          [MORE]<a href="{ARTICLELINK}" class="moreLink">view case</a>[/MORE]</div>
        [IMAGE]<div class="projectTeaser"><a href="{ARTICLELINK}">{IMAGE}</a>[SUB]<span class="projectClient"> {SUB} </span>[/SUB]
          [TITLE]<h3>{TITLE}</h3>[/TITLE]
        </div>
      </div>[/IMAGE]
      
      <!--template/inc_cntpart/articlesummary/list/projects_lists.tmpl-->

    <!-- [ARTICLEID]{ARTICLEID}[/ARTICLEID]-->
    [BEFORE]<!--BEFORE-->[/BEFORE]
    [AFTER]<!--AFTER-->[/AFTER]
      [SUB]<div class="projectItem grid_3">
        <div class="projectText cor"[CAPTION] style="background-color:{CAPTION}"[/CAPTION]> <span class="projectClient">{SUB}</span>[/SUB]
          [TITLE]<h3>{TITLE}</h3>[/TITLE]
          [SUMMARY]{SUMMARY}[/SUMMARY]
          [MORE]<a href="{ARTICLELINK}" class="moreLink">view case</a>[/MORE]</div>
        [IMAGE]<div class="projectTeaser"><a href="{ARTICLELINK}">{IMAGE}</a>[SUB]<span class="projectClient"> {SUB} </span>[/SUB]
          [TITLE]<h3>{TITLE}</h3>[/TITLE]
        </div>
      </div>[/IMAGE]
      
      <!--template/inc_cntpart/articlesummary/list/projects_lists.tmpl-->

    <!-- [ARTICLEID]{ARTICLEID}[/ARTICLEID]-->
    [BEFORE]<!--BEFORE-->[/BEFORE]
    [AFTER]<!--AFTER-->[/AFTER]
      [SUB]<div class="projectItem grid_3">
        <div class="projectText cor"[CAPTION] style="background-color:{CAPTION}"[/CAPTION]> <span class="projectClient">{SUB}</span>[/SUB]
          [TITLE]<h3>{TITLE}</h3>[/TITLE]
          [SUMMARY]{SUMMARY}[/SUMMARY]
          [MORE]<a href="{ARTICLELINK}" class="moreLink">view case</a>[/MORE]</div>
        [IMAGE]<div class="projectTeaser"><a href="{ARTICLELINK}">{IMAGE}</a>[SUB]<span class="projectClient"> {SUB} </span>[/SUB]
          [TITLE]<h3>{TITLE}</h3>[/TITLE]
        </div>
      </div>[/IMAGE]
      
</div>
      </div>
<!---->
</div>
<div id="footer">
  <div id="foot" class="containers_12">
    <div class="grids_9">
      <!---->
      {NAV_LIST_UL:P,0}
      <!---->
    </div>
    <div class="grids_3">
      <ul>
        <li>Isac Araújo Communication Design</li>
        <li>All Rights Reserved © 2010</li>
      </ul>
    </div>
    <div class="clear">&nbsp;</div>
  </div>
</div>

And the article like this

Code: Select all

<div id="header"></div>
<div id="content" class="containers_12">
  <!---->
<!--template/inc_cntpart/articlesummary/article/projects_single.tmpl-->
<div class="projectSingle">[TITLE]
  <h3 class="grids_12">{TITLE}</h3>
  [/TITLE]{SLIDESHOW}
</div>
<div class="clear" style="padding-top: 25px;">&nbsp;</div>
 <!---->
</div>
<div id="footer">
  <div id="foot" class="containers_12">
    <div class="grids_9">
      <!---->
      {NAV_LIST_UL:P,0}
      <!---->
    </div>
    <div class="grids_3">
      <ul>
        <li>Isac Araújo Communication Design</li>
        <li>All Rights Reserved © 2010</li>
      </ul>
    </div>
    <div class="clear">&nbsp;</div>
  </div>
</div>
How to include this before and after in article list template and not in the article?

Code: Select all

 <div id="project_list">
<div id="gridView" class="gridView">
.
.
.
[color=#FF0000]</div>
</div>
Last edited by isac on Wed 24. Feb 2010, 13:12, edited 1 time in total.
POR :D TUGAL
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: wrap article summary list template

Post by flip-flop »

Code: Select all

<!--IF_LIST_MODE_START//--> <div id="project_list"><div id="gridView" class="gridView"><!--IF_LIST_MODE_END//-->
<!--ELSE_LIST_MODE_START//--><div class="full-article"><!--ELSE_LIST_MODE_END//-->
{CONTENT}
<!--ELSE_LIST_MODE_START//--></div><!--ELSE_LIST_MODE_END//-->
<!--IF_LIST_MODE_START//--></div></div><!--IF_LIST_MODE_END//-->


I can´t understand your problem. This article list tag we all have forgotten (it is avaialbe since V1.3.3 2007-05-18) :oops: .

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Re: wrap article summary list template

Post by isac »

Thank you for your support. The problem is me. I don't follow development and updates for three years. Shame on me :D Spent two days using search

I found it http://forum.phpwcms.org/viewtopic.php?f=1&t=14796
POR :D TUGAL
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: wrap article summary list template

Post by Oliver Georgi »

isac wrote:Please be patient because :)
Please no colors for code - use the

Code: Select all

 BB Tag
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: wrap article summary list template

Post by update »

Back from eye disease doctor - with 3D glasses now ;)
Yes - list mode is the word I have been looking for too :oops:
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
isac
Posts: 410
Joined: Tue 18. Nov 2003, 13:13
Location: Portugal
Contact:

Re: wrap article summary list template

Post by isac »

I get my eyes burn reading this page in my macbook too

I changed the color to bb code.
POR :D TUGAL
Post Reply