Page 2 of 3

Posted: Mon 13. Jun 2005, 06:31
by macangelo
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

Posted: Fri 26. Aug 2005, 23:08
by kubens
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.

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'])) . "'>&nbsp;</td>";
    }  
    
    // close outer table
    echo "</tr></table>"; 
  }
[/PHP]
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

Posted: Sat 27. Aug 2005, 13:53
by kubens
You can see this article list here. :shock:

Posted: Sat 27. Aug 2005, 14:58
by macangelo
Thanks - and have a nice weekend

Macangelo

Posted: Sun 28. Aug 2005, 21:23
by ChantalC
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?

Posted: Sun 28. Aug 2005, 22:03
by kubens
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:

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 --> 
BR
Wolfgang

Posted: Sun 28. Aug 2005, 23:27
by ChantalC
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?

Posted: Mon 29. Aug 2005, 08:58
by kubens
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 :shock: 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

Posted: Thu 8. Sep 2005, 03:32
by StudioZ
Just discovered this thread here :roll:
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

Posted: Fri 16. Dec 2005, 17:49
by sCHL
Hi,

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'])) . "'>&nbsp;</td>";
    } 
   
    // close outer table
    echo "</tr></table>";
  }
[/PHP] 
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...

Posted: Fri 16. Dec 2005, 18:12
by sCHL
Ok, i got it: mixing of listing templates is not allowed. My first article listing ist a text which discribes the content. After this there a pictures for the portfolio. And this pictures have an other template...

Posted: Sun 1. Jan 2006, 08:42
by Stim
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.

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'])) . "'>&nbsp;</td>";
    }  
    
    // close outer table
    echo "</tr></table>"; 
  }
[/PHP]
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


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?

Posted: Mon 2. Jan 2006, 00:28
by Stim
OK
Already fixed…

Posted: Mon 2. Jan 2006, 09:05
by sCHL
And how? It would be nice to post the solution for those with same problems :wink:

Posted: Mon 2. Jan 2006, 14:42
by Stim
Hello
Sorry! My solution was this topic http://www.phpwcms.de/forum/viewtopic.php?t=9597 only. :wink: 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