I'm making a news webpage using campsite. I would like to know how to modify the sections in the homepage separately, so to place within the same section a background without changing the others. I also want to put into the same section 3 secondary news below the main news. I also want to know how I can creat a secundary menu without changing the top menu.
It looks to me more like a layout issue rather than a Campsite
specific question.
Campsite template engine is Smarty-based, so you can create your
template files (.tpl) with practically any layout you want and just
embed Campsite template tags to pull the data and place it wherever
you need. For example:
Code above is quite simple but it helps to illustrate how something
like "to put into the same section 3 secondary news below the main
news" may be done:
Line below define which section the articles will be fetched from.
{{ set_section number=10 }}
Then we declare the list. Length is 4 articles because that is what we
want (main and 3 more). We use OnFrontPage but it may well be
OnSection depending on what kind of page you are building.
{{ list_articles name="articles" length="4" constraints="OnFrontPage
is on" ignore_issue=true }}
Now we ask if we are at the beginning of the list, that is 1st element
(main news), if so it prints article publish date, title and intro
with specific styling. Here I am assuming default ordering, you can
read more about ordering conditions at http://code.campware.org/manuals/campsite/3.3/index.php?id=7 5
{{ if $campsite->current_list->at_beginning }}
If not, it prints only article publish date and title for the other 3
news (2nd to 4th in the list) with specific styling as well.
And that's it. As I said, code in the example is basic html, you can
use instead xml, tableless coding, whatever, and structure your
document to fit your needs.
As for the secondary menu, it depends on how you structure the content
within Campsite, it might be built from sections list, topics list.
Hope this helps.
On Thu, May 6, 2010 at 3:24 PM, Lorena
<campsite-support@lists.sourcefabric.org> wrote:
>
> I'm making a news webpage using campsite. I would like to know how to modify the sections in the homepage separately, so to place within the same section a background without changing the others. I also want to put into the same section 3 secondary news below the main news. I also want to know how I can creat a secundary menu without changing the top menu.
>
Thank you Holman i try to use the table but it only recognize one article and repeat it 3 times... do you have a different code than could work with that?
Lorena, may you please send the entire template file so that I can check if there is something wrong. Code works ok to me in Campsite 3.3.5. Make sure you have any articles in the section you set and at least 1 article with "Show article on front page" checked.