Page 1 of 1
wrap article summary list template
Posted: Tue 23. Feb 2010, 15:15
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 //-->
Re: wrap article summary list template
Posted: Tue 23. Feb 2010, 15:54
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
Re: wrap article summary list template
Posted: Tue 23. Feb 2010, 16:11
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.
Re: wrap article summary list template
Posted: Tue 23. Feb 2010, 16:31
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.
Re: wrap article summary list template
Posted: Tue 23. Feb 2010, 18:22
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
Re: wrap article summary list template
Posted: Tue 23. Feb 2010, 22:44
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">
<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//-->
Re: wrap article summary list template
Posted: Wed 24. Feb 2010, 00:22
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"> </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;"> </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"> </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;"> </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"> </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>
Re: wrap article summary list template
Posted: Wed 24. Feb 2010, 02:53
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)

.
Knut
Re: wrap article summary list template
Posted: Wed 24. Feb 2010, 03:31
by isac
Thank you for your support. The problem is me. I don't follow development and updates for three years. Shame on me

Spent two days using search
I found it
http://forum.phpwcms.org/viewtopic.php?f=1&t=14796
Re: wrap article summary list template
Posted: Wed 24. Feb 2010, 08:16
by Oliver Georgi
isac wrote:Please be patient because
Please no colors for code - use the
Re: wrap article summary list template
Posted: Wed 24. Feb 2010, 09:10
by update
Back from eye disease doctor - with 3D glasses now

Yes - list mode is the word I have been looking for too

Re: wrap article summary list template
Posted: Wed 24. Feb 2010, 13:14
by isac
I get my eyes burn reading this page in my macbook too
I changed the color to bb code.