article-listing in columns
Hi Brans
Well, I chose to force it by a spacer in the table. IE made problems excepting these height-things, but this works at least ok:
http://www.eyelikeit.com/index.php?de_www_example_cms
I also posted this question in the selfhtml-forum but didn't get a solution I could use:
helphttp://forum.de.selfhtml.org/?t=109454&m=683958
Thanks for your Help
macangelo
Well, I chose to force it by a spacer in the table. IE made problems excepting these height-things, but this works at least ok:
http://www.eyelikeit.com/index.php?de_www_example_cms
I also posted this question in the selfhtml-forum but didn't get a solution I could use:
helphttp://forum.de.selfhtml.org/?t=109454&m=683958
Thanks for your Help
macangelo
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
http://eyelikeit.com/index.php?de_beispiele-webdesign
Based on the internal order of frontend rendering I pointed out the following solution. The code below renders an article list into a table which contains two columns. Just copy this source into an article list template.
This source was tested successfully in phpWCMS v1.2.5-DEV. By the way, to integrate information from external tables (e.g. prices and stock information) inside an article listing, this is a very good approach.
BR
Wolfgang
Code: Select all
[PHP]
// number of columns
$GLOBALS['wak_cols'] = 2;
// initialize or increase counter
if (!isset($GLOBALS['wak_counter'])) {
$GLOBALS['wak_counter'] = 0;
}
else {
$GLOBALS['wak_counter']++;
}
// articles per listing
// either topcount from category
// or number of listed articles of category
$article_id = "{ARTICLEID}";
$article_cid = $GLOBALS['content']['articles'][$article_id]['article_cid'];
if ($GLOBALS['content']['struct'][$article_cid]['acat_topcount'] < count($GLOBALS['content']['articles'])) {
$GLOBALS['wak_articles_per_page'] = $GLOBALS['content']['struct'][$article_cid]['acat_topcount'];
}
else {
$GLOBALS['wak_articles_per_page'] = count($GLOBALS['content']['articles']);
}
// create outer table
// which contains the columns
if ($GLOBALS['wak_counter'] == 0) { echo "<table border='1'><tr>"; }
// if number of columns per row
// is reached then create new row
if ($GLOBALS['wak_counter'] % $GLOBALS['wak_cols'] == 0) { echo "</tr><tr>"; }
[/PHP]
<td>
<!-- content begin -->
<table border="0" cellspacing="10">
<tr>
<td width="150" valign="top">
[IMAGE]<div><a href="{ARTICLELINK}">{IMAGE}</a></div>[/IMAGE]
[CAPTION]<div align="center">{CAPTION}</div>[/CAPTION]
</td>
<td valign="top">
[TITLE]<h1 style="margin:0 0 5px 0;">{TITLE}</h1>[/TITLE]
[SUB]<h3 style="margin:0 0 5px 0;">{SUB}</h3>[/SUB]
[SUMMARY]<p style="margin:0">{SUMMARY}</p>[/SUMMARY]
[MORE]<a href="{ARTICLELINK}">{MORE}</a>[/MORE]
</td>
</tr>
</table>
<!-- content end -->
</td>
[PHP]
// if number of articles per category
// is reached then close outer table
if ($GLOBALS['wak_counter']+1 == $GLOBALS['wak_articles_per_page']) {
// if last row does not contain enough
// columns then create a filler column
if (($GLOBALS['wak_counter']+1) % $GLOBALS['wak_cols'] > 0 ) {
echo "<td colspan='" . ($GLOBALS['wak_cols'] - (($GLOBALS['wak_counter']+1) % $GLOBALS['wak_cols'])) . "'> </td>";
}
// close outer table
echo "</tr></table>";
}
[/PHP]
BR
Wolfgang
Thanks - and have a nice weekend
Macangelo
Macangelo
Webdesign from Düsseldorf - made with phpwcms (most of it):
http://eyelikeit.com/index.php?de_beispiele-webdesign
http://eyelikeit.com/index.php?de_beispiele-webdesign
Ich habe ein ähnliches Problem. Ich möchte die Artikelliste rechts, aber nur die Images mit Link. Der Content der Artikel soll in der Mitte sein.
Meine Frage ist, wie bekomme ich die Artikelliste, nur Images, nach rechts?
Seitenlayout: Content + Rechts? mit welchen Replacement-Tags? oder über Tabelle oder über Layer?
Meine Frage ist, wie bekomme ich die Artikelliste, nur Images, nach rechts?
Seitenlayout: Content + Rechts? mit welchen Replacement-Tags? oder über Tabelle oder über Layer?
Last edited by ChantalC on Sat 3. Sep 2005, 11:13, edited 1 time in total.
Gruß / regards
CC
CC
Please create an separate tmpl file and save it in the corresponding folder /phpwcms_template/inc_cntpart/articlesummary/list. Reasign the article list template to the corresponding articles... To achieve that the images in the article listing appears on the right side just modify the html source from my previous posting:
BR
Wolfgang
Code: Select all
<!-- content begin -->
<table border="0" cellspacing="10">
<tr>
<td valign="top">
[TITLE]<h1 style="margin:0 0 5px 0;">{TITLE}</h1>[/TITLE]
[SUB]<h3 style="margin:0 0 5px 0;">{SUB}</h3>[/SUB]
[SUMMARY]<p style="margin:0">{SUMMARY}</p>[/SUMMARY]
[MORE]<a href="{ARTICLELINK}">{MORE}</a>[/MORE]
</td>
<td width="150" valign="top">
[IMAGE]<div><a href="{ARTICLELINK}">{IMAGE}</a></div>[/IMAGE]
[CAPTION]<div align="center">{CAPTION}</div>[/CAPTION]
</td>
</tr>
</table>
<!-- content end -->
Wolfgang
Danke für die schnelle Antwort.
Aber irgendwas klappt nicht bei mir. Vielleicht ist es auch zu spät heute ( ).
Mein Ergebnist sieht jetzt so aus.
Wir kriege ich die Artikelliste (nur Images) nach rechts + den 1. Content in die Mitte?
Aber irgendwas klappt nicht bei mir. Vielleicht ist es auch zu spät heute ( ).
Mein Ergebnist sieht jetzt so aus.
Wir kriege ich die Artikelliste (nur Images) nach rechts + den 1. Content in die Mitte?
Last edited by ChantalC on Sat 3. Sep 2005, 11:13, edited 1 time in total.
Gruß / regards
CC
CC
Okay, it seems that this isn't an article listing. Please verify your settings for the corresponding structure entry in your site structure. Especialy check top article count In case that you are not familiar with this parameter try to find out more details at Pappnase's famous Docupage If this is parameter is setuped correct, please verify the settings on article level concerning the right article listing template. See my previous posting. If you can't find a way to solve your problem send me a PM
BR
Wolfgang
BR
Wolfgang
Just discovered this thread here
and realized that it is VERY closely related to
erich_k4's famous {TEASER_EX} tag.
This tag is bringing up whole new possibilities and horizons.
I just posted there, some enhancements I would very soon need...
Please check:
http://www.phpwcms.de/forum/viewtopic.php?p=48696#48696
Cheers,
Yves
and realized that it is VERY closely related to
erich_k4's famous {TEASER_EX} tag.
This tag is bringing up whole new possibilities and horizons.
I just posted there, some enhancements I would very soon need...
Please check:
http://www.phpwcms.de/forum/viewtopic.php?p=48696#48696
Cheers,
Yves
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!
Hi,
great Code, but I have a problem with the last part:
In my case the closing tag is not generated. Perhaps it depends on the counting of the articles. Has anybody similar problems? Thanks for response...
great Code, but I have a problem with the last part:
Code: Select all
[PHP]
// if number of articles per category
// is reached then close outer table
if ($GLOBALS['wak_counter']+1 == $GLOBALS['wak_articles_per_page']) {
// if last row does not contain enough
// columns then create a filler column
if (($GLOBALS['wak_counter']+1) % $GLOBALS['wak_cols'] > 0 ) {
echo "<td colspan='" . ($GLOBALS['wak_cols'] - (($GLOBALS['wak_counter']+1) % $GLOBALS['wak_cols'])) . "'> </td>";
}
// close outer table
echo "</tr></table>";
}
[/PHP]
kubens wrote:Based on the internal order of frontend rendering I pointed out the following solution. The code below renders an article list into a table which contains two columns. Just copy this source into an article list template.
This source was tested successfully in phpWCMS v1.2.5-DEV. By the way, to integrate information from external tables (e.g. prices and stock information) inside an article listing, this is a very good approach.Code: Select all
[PHP] // number of columns $GLOBALS['wak_cols'] = 2; // initialize or increase counter if (!isset($GLOBALS['wak_counter'])) { $GLOBALS['wak_counter'] = 0; } else { $GLOBALS['wak_counter']++; } // articles per listing // either topcount from category // or number of listed articles of category $article_id = "{ARTICLEID}"; $article_cid = $GLOBALS['content']['articles'][$article_id]['article_cid']; if ($GLOBALS['content']['struct'][$article_cid]['acat_topcount'] < count($GLOBALS['content']['articles'])) { $GLOBALS['wak_articles_per_page'] = $GLOBALS['content']['struct'][$article_cid]['acat_topcount']; } else { $GLOBALS['wak_articles_per_page'] = count($GLOBALS['content']['articles']); } // create outer table // which contains the columns if ($GLOBALS['wak_counter'] == 0) { echo "<table border='1'><tr>"; } // if number of columns per row // is reached then create new row if ($GLOBALS['wak_counter'] % $GLOBALS['wak_cols'] == 0) { echo "</tr><tr>"; } [/PHP] <td> <!-- content begin --> <table border="0" cellspacing="10"> <tr> <td width="150" valign="top"> [IMAGE]<div><a href="{ARTICLELINK}">{IMAGE}</a></div>[/IMAGE] [CAPTION]<div align="center">{CAPTION}</div>[/CAPTION] </td> <td valign="top"> [TITLE]<h1 style="margin:0 0 5px 0;">{TITLE}</h1>[/TITLE] [SUB]<h3 style="margin:0 0 5px 0;">{SUB}</h3>[/SUB] [SUMMARY]<p style="margin:0">{SUMMARY}</p>[/SUMMARY] [MORE]<a href="{ARTICLELINK}">{MORE}</a>[/MORE] </td> </tr> </table> <!-- content end --> </td> [PHP] // if number of articles per category // is reached then close outer table if ($GLOBALS['wak_counter']+1 == $GLOBALS['wak_articles_per_page']) { // if last row does not contain enough // columns then create a filler column if (($GLOBALS['wak_counter']+1) % $GLOBALS['wak_cols'] > 0 ) { echo "<td colspan='" . ($GLOBALS['wak_cols'] - (($GLOBALS['wak_counter']+1) % $GLOBALS['wak_cols'])) . "'> </td>"; } // close outer table echo "</tr></table>"; } [/PHP]
BR
Wolfgang
Hi
Nice cod!!
But I have some problem when I use other templates. Example: I have 5 articles and 4 of them I use 1.tmpl whit this cod above and locus like this:
Article 1:--------------------------------Article 2:
Text text text text text text----------Text text text text text text
Text text text text text text ---------Text text text text text text
Article 3:--------------------------------Article 4:
Text text text text text text---------Text text text text text text
Text text text text text text---------Text text text text text text
White article 5 I trying to make this lock:
Article 1:--------------------------------Article 2:
Text text text text text text----------Text text text text text text
Text text text text text text ---------Text text text text text text
Article 3:--------------------------------Article 4:
Text text text text text text---------Text text text text text text
Text text text text text text---------Text text text text text text
Article 5:
Text text text text text text text text text text text text text
Text text text text text text text text text text text text text
But its not work when I try to add other .tmpl. I think there maybe is something wrong in the cod above: Any ideas?
Hello
Sorry! My solution was this topic http://www.phpwcms.de/forum/viewtopic.php?t=9597 only. But you have to remove that dotted thing. I don’t know why there are dots in that cod. But just remove it and then it will work
Sorry! My solution was this topic http://www.phpwcms.de/forum/viewtopic.php?t=9597 only. But you have to remove that dotted thing. I don’t know why there are dots in that cod. But just remove it and then it will work