 |

George_h
User
Nov 5, 2006, 1:49 PM
Post #1 of 14
(2967 views)
Shortcut
|
|
Multi column layouts easier AM 2.02
|
Can't Post
|
|
I noticed in the upgrade notes for AM2.02 that there are a couple of new TemplateIF commands that is going to make multi column layouts easier. I was wondering if someone could give a brief tutorial on how this can be done. The inability to have easy colums in AM1 was always a bit of a pain so I am excited to see it mentioned in 2.02 Kind Regards George
|
|
|  |
 |

Dave
Staff
/ Moderator

Nov 6, 2006, 11:43 AM
Post #2 of 14
(2954 views)
Shortcut
|
|
Re: [George_h] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Here's how you do it, or at least, one way to do it! :) When you are publishing an "article list" and you want it to be multi column you need to insert a break or a closing row tag ever N records. If you wanted your columns to run left to right like this: 1 2 3 4 Then you could use some code like this: <table border=1 cellspacing=0 cellpadding=0> <tr> <!-- template insert : $articleList$ --> <!-- templatecell : articleRow --> <td><a href="$published.articlePage.url$">$article.title$</a> - $article.summary:maxWords(10)$</td> <!-- templateIf: $articleList.currentResultCounter$ isMultipleOf "2" --></tr><tr><!-- /templateIf --> <!-- /templatecell : articleRow --> </tr> </table> Or if you wanted them top to bottom like this: 1 5 2 6 3 7 4 8 You could do this: <table border=1 cellspacing=0 cellpadding=0> <tr><td> <!-- template insert : $articleList$ --> <!-- templatecell : articleRow --> <a href="$published.articlePage.url$">$article.title$</a> - $article.summary:maxWords(10)$<br/><br/> <!-- templateIf: $articleList.currentResultCounter$ isMultipleOf "5" --></td><td valign="top"><!-- /templateIf --> <!-- /templatecell : articleRow --> </td></tr> </table> Basically what's happening is $articleList.currentResultCounter$ gives us the number of the article on the page. The first article being 1 the second being 2, etc. And we use templateIf and "isMultipleOf" to insert some extra html tags after every N articles. Hope that helps. Let me know if you have any questions about that or how far you get with it! :) Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

George_h
User
Nov 7, 2006, 2:36 AM
Post #3 of 14
(2925 views)
Shortcut
|
|
Re: [Dave] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
WOW! Thank you Dave for a speedy response and for the code. I have changed the code a bit to fit my site, I have used it to display the 50 latest article pages, here is what I used <table border=0 cellspacing=0 cellpadding=0> <tr><td width="50%"align="left" valign="top" style="border-right:30px solid #ffffff;"> <!-- template insert : $articleList$ --> <!-- templatecell : articleRow --> <span class="summary_title">$articleList.currentResultCounter$. <a href="$published.articlePage.url$" title="$article.summary$">$article.title:maxWords(6)$</a></span><br/> <!-- templateIf: $articleList.currentResultCounter$ isMultipleOf "25" --></td> <td width="50%"align="left" valign="top"><!-- /templateIf --> <!-- /templatecell : articleRow --> </td></tr> </table> To keep the table tidy I have limied the number of words to 6, and it can be seen on my home page www.tips.net Kind Regards George
|
|
|  |
 |

Dave
Staff
/ Moderator

Nov 7, 2006, 11:26 AM
Post #4 of 14
(2903 views)
Shortcut
|
|
Re: [George_h] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Hey, that looks great! I'm glad I could help, and then you could get it working so quickly! :) You have a great domain too. It can be hard these days to get a short memorable domain. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

LostCoder
User
Nov 30, 2006, 8:35 AM
Post #5 of 14
(2794 views)
Shortcut
|
|
Re: [Dave] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Hi, I thought I would post here as it may be somewhat related. In my article list, I am listing each article on it's own row in 3 columns as follows: ARTICLE TITLE | DATE | CATEGORY What I am trying to do is rotate the background color of the row. So, the first row might be light grey, and the second row might be white, much like the Category List area in the AM 2.0 "Categories' tab. Here is a sample of the code i am using in my ArticleList Rule: <table width="770" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999"> <!-- template insert : $articleList$ --> <!-- templatecell : articleRow --> <tr> <td width="470"><div id="list_item"><a href="$published.articlePage.url$">$article.title$</a></div></td> <td width="200"><div id="list_item">$article.date:format(MMMM d, yyyy)$</div></td> <td width="100"><div id="list_item">$category.name$</div></td> </tr> <!-- /templatecell : articleRow --> <!-- templateIf : $articleList$ eq "" --> <tr><td>No articles available for this category</td></tr> <!-- /templateIf --> <!-- templateCell : pageDefault.embeddedMedia --> <!-- templateIf : $file.caption$ ne '' --> <!-- /templateIf --> <!-- templateIf : $file.caption$ eq '' --> <!-- /templateIf --> <!-- /templateCell : pageDefault.embeddedMedia --> </tr> </table> ---Do you have any ideas on how to make the row color rotate ? Any help would be very much appreciated. Thanks. LC
(This post was edited by LostCoder on Nov 30, 2006, 2:17 PM)
|
|
|  |
 |

Donna
Staff
/ Moderator

Dec 1, 2006, 9:59 AM
Post #6 of 14
(2768 views)
Shortcut
|
|
Re: [LostCoder] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Hey LostCoder! :) This is where the "isMultipleOf" modifier is going to come in handy. So, you'd have something like this:
<table width="770" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999"> <!-- template insert : $articleList$ --> <!-- templatecell : articleRow --> <!-- templateIf: $articleList.currentResultCounter$ isMultipleOf "2" --> <tr style="background-color: #eee;"> <!-- /templateIf --> <!-- templateIf: $articleList.currentResultCounter$ isNotMultipleOf "2" --> <tr style="background-color: #fff;"> <!-- /templateIf --> <td width="470"><div id="list_item"><a href="$published.articlePage.url$">$article.title$</a></div></td> <td width="200"><div id="list_item">$article.date:format(MMMM d, yyyy)$</div></td> <td width="100"><div id="list_item">$category.name$</div></td> </tr> <!-- /templatecell : articleRow --> <!-- templateIf : $articleList$ eq "" --> <tr><td>No articles available for this category</td></tr> <!-- /templateIf --> <!-- templateCell : pageDefault.embeddedMedia --> <!-- templateIf : $file.caption$ ne '' --> <!-- /templateIf --> <!-- templateIf : $file.caption$ eq '' --> <!-- /templateIf --> <!-- /templateCell : pageDefault.embeddedMedia --> </tr> </table> Give that a try and let me know if it works for you. :) Donna
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

DefenceTalk.com
User
Dec 2, 2006, 10:11 PM
Post #7 of 14
(2747 views)
Shortcut
|
|
Re: [Dave] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
How about 1 6 2 o* 3 7 o 8 4 9 5 10 or just switch it a little bit 1 6 o 7 2 8 3 o 4 9 5 10 * o= Ads or other content
|
|
|  |
 |

ross
Staff
/ Moderator

Dec 3, 2006, 1:53 PM
Post #8 of 14
(2732 views)
Shortcut
|
|
Re: [DefenceTalk.com] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Hi Thanks for posting! Inserting ads like that should be quite simple. One or two strategically placed templateIf's should get the job done. Basically, follow Dave's tutorial on getting your columns setup, then find this part in your template:
<!-- template insert : $articleList$ --> and add this right after:
<!-- templateIf: $articleList.currentResultCounter$ == 4 --> PUT ADD CODE HERE <!-- /templateIf --> That's basically going to insert some ad code right before the 4th article. You can adjust that number so the ad shows up in different places. You can even add a whole new template if block right after that with a different number so you have ads showing up twice. Does that make sense? Give it a shot and let me know how you make out . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

Jesus
User
Dec 19, 2006, 11:11 AM
Post #9 of 14
(2656 views)
Shortcut
|
|
Re: [ross] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Hi everybody... . Im working trying to adjust my category templates to display 10 articles in 2 columns using a code like this...
<div class="text_place"> <h3>$article.title$</h3> <a href="$published.articlePage.url$" class="biglink" title="$article.PromoTitle$">$article.PromoTitle$</a> <p>$article.summary$<br /><a href="$published.articlePage.url$" class="green" title="Presione aqui para ingresar ">Presione aqui para ingresar </a> </p> </div> <div class="text_place"> <h3>$article.title$</h3> <a href="$published.articlePage.url$" class="biglink" title="$article.PromoTitle$">$article.PromoTitle$</a> <p>$article.summary$<br /><a href="$published.articlePage.url$" class="green" title="Presione aqui para ingresar ">Presione aqui para ingresar </a> </p> </div> <div class="mr_clear_brd"> </div> My listing needs to be like this: 1 2 3 4 5 6 7 8 9 10 and it will display up to 10 per page... so the 2nd page it will look like this as well: 11 12 13 14 15 16 17 18 19 20 I think I still need to figure it out the if statement to make this to happen.. also I used to had (on my previous AM version) <!-- templatecell : row2 --> tags so how do I'll use it on AM2 Thanks for pointing me to the right direction on this. Jesus PS Please note that I add a custom text field already that I'm calling it with this variable: $article.PromoTitle$ Also, I'm not using tables on my site design, but my code already handles the 2 columns, i'm just trying to replace text with the proper variables to make it work.
|
|
|  |
 |

Jesus
User
Dec 19, 2006, 2:18 PM
Post #10 of 14
(2649 views)
Shortcut
|
|
Re: [Jesus] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
I'm getting close.... :p Still having issues with the IF statement....
<!-- templatecell : articleRow --> <div class="text_place"> <h3>$article.title$</h3> <a href="$published.articlePage.url$" class="biglink" title="$article.PromoTitle$">$article.PromoTitle$</a> <p>$article.summary$ <a href="$published.articlePage.url$" class="green" title="Presione aqui para ingresar ">Presione aqui para ingresar </a> </p> <!-- templateIf: $articleList.currentResultCounter$ isMultipleOf "2" --></div> <div class="text_place"> <h3>$article.title$</h3> <a href="$published.articlePage.url$" class="biglink" title="$article.PromoTitle$">$article.PromoTitle$</a> <p>$article.summary$ <a href="$published.articlePage.url$" class="green" title="Presione aqui para ingresar ">Presione aqui para ingresar </a> </p><!-- /templateIf --> </div> <div class="mr_clear_brd"> </div> <!-- /templatecell : articleRow -->
|
|
|  |
 |

Jesus
User
Dec 20, 2006, 8:12 AM
Post #11 of 14
(2631 views)
Shortcut
|
|
Re: [Jesus] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Hi all.... I think i'm closer than ever, still have a few details on my template... Here its a copy of the code that i'm using it and my site generates. If click on the view source you will notice a few divs that open and close immediately. Still its a place where i'm using the IF statement.. hope someone can help!
<!-- templatecell : articleRow --> <div class="text_place"> <h3>$article.title$</h3> <a href="$published.articlePage.url$" class="biglink" title="$article.PromoTitle$">$article.PromoTitle$</a> <p>$article.summary$ <a href="$published.articlePage.url$" class="green" title="Presione aqui para ingresar ">Presione aqui para ingresar </a> </p> <!-- templateIf: $articleList.currentResultCounter$ isMultipleOf "2" --> </div> <div class="text_place"> <!-- /templateIf --> </div> <!-- /templatecell : articleRow --> <div class="mr_clear_brd"> </div> Thanks for the help in advance Jesus
(This post was edited by Jesus on Jan 4, 2007, 12:37 PM)
|
|
|  |
 |

ross
Staff
/ Moderator

Dec 21, 2006, 8:56 AM
Post #13 of 14
(2586 views)
Shortcut
|
|
Re: [Jesus] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Hi Jesus. Thanks for posting and for the updates! I am going to get you to try floodrod's suggestion there as I also think that's going to get you back on track. I apologize for missing that in my original post. If that doesn't you going though, would you mind sending me some FTP details so I can take a closer look? You can send them through our support form: https://www.interactivetools.com/support/email_support.cgi How does that sound? Keep me up to date with how you are making out . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

Jesus
User
Dec 21, 2006, 9:07 AM
Post #14 of 14
(2581 views)
Shortcut
|
|
Re: [ross] Multi column layouts easier AM 2.02
[In reply to]
|
Can't Post
|
|
Hi Ross, I just sent the support request. Hope you can see it soon :) Jesus
|
|
|  |
|