Forums / Setup & design / Placing an article on any part of the page that you want

Placing an article on any part of the page that you want

Author Message

Emmanuels magaya

Wednesday 13 October 2004 3:20:48 am

I have yet another question...On my homepage I wish to custom make the html - but my problem is when I want to display the dynamic content, it all comes up under the one section that I will have placed the code "{$module_result.content}" thereby listing all articles in say one table. I wish to be able to display a given article in a given section of the page or given table - according to the way I design my page.

Secondly - is it possible to custom design your own theme or page layout so that you can have a page that is exactly as you want or you can ONLY use the available themes?

Marko Žmak

Wednesday 13 October 2004 5:55:51 am

Sollution for the first problem:

First you should find the node of the article you want to display. You can do that by using the fetch function (see the Documentation Reference on EZ site). Then when you find the node, say it's $node you can use something like this:

{attribute_view_gui attribute=$article_node.object.data_map.intro}
{attribute_view_gui attribute=$article_node.object.data_map.thumbnail}
{attribute_view_gui attribute=$article_node.object.data_map.body}
{$article_node.object.data_map.title.content}

to dislplay article intro, thumbnail, body and title. You can put it enywhere in your HTML. Thumbnail is a picture you upload with the article, intro and body are XML fields so it will be displyed as formated HTML when you use attribute_view_gui (e.g. if you used bold when editing article body, it will be displayed that way).

The template code for the main page is in pagelayout.tpl. Yust edit it as any other template. And remember to clear the caches after edititng it, otherwise the changes will not be displayed.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Emmanuels magaya

Wednesday 13 October 2004 6:19:31 am

Thanks for that information. My homepage design is on the following link...
http://www.teenzone.co.zw/Home-Page4.jpg

and I wish to have the section written Latest News and Featured Products being dymnamic. i.e. the images and the text as well. Please tell me how I can go about this.

Marko Žmak

Wednesday 13 October 2004 8:20:17 am

I don't quite understant what you really want. Please explain in more details.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Emmanuels magaya

Wednesday 13 October 2004 11:41:05 pm

What I mean is...if yu look at the normal homepage for this site - it consists of a header, body and footer. However, what I want is to have my website in the form that is in the image on the link I mentioned in my prev post. The left side of the website - the side with the picture will be static BUT whats on the right will be dynamic. Secondly - the subpages will have a format different from the homepage - they will have a structure similar to that of this website(Header. body, footer). In my current website - the right side is dynamic but if I click on the links for say latest news - it displays the data on the same page and yet I wish to have it go to a page with a layout different from the homepage.

if yu are on IM we can chat my msn id is emmagaya@hotmail.com and my yahoo id is emmagaya. Just add me to your contacts so I can explain further if necessary

Alex Jones

Thursday 14 October 2004 6:32:48 am

Hi Emmanuels, have you seen the 'Building an eZ publish site tutorial? The questions you are asking are covered within it, plus there is a lot of other information that would be good for you to know. I have provided a link to it, and a couple of pages within that should help with your specific problem. In addition to Marko's suggestions, you may also want to read up on <i>fetch</i> as it is the foundation for displaying information in your templates.

<b>eZ publish Tutorial</b>: http://ez.no/ez_publish/documentation/toc/(from)/36647
<b>Creating and using a custom template:</b> http://ez.no/ez_publish/documentation/building_an_ez_publish_site/the_welcome_page/creating_and_using_a_custom_template
<b>Overview of the latest news:</b> http://ez.no/ez_publish/documentation/building_an_ez_publish_site/the_news_page/overview_of_the_latest_news
<b>Data Fetching</b> http://ez.no/ez_publish/documentation/reference/data_fetching

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>