Content inside Content with smarty

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
tmhai

Content inside Content with smarty

Post by tmhai »

Hello,

Is it possible to use the 'assign' parameter in the {content} tag for the use of a smarty template? Im trying to add an image floating to the left on every page, and i dont want to have to edit each page seperately.
jelle

Re: Content inside Content with smarty

Post by jelle »

I don't get your question? If all you want to do is have the same image in every page, edit your templates for that. If you need a different image, it might be simpler to just use a different template.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Content inside Content with smarty

Post by calguy1000 »

if for example, your image name is encoded with your page name, then you can do something like:  in your template.

use the get_template_vars plugin to find out exactly what the variable is. 

Technically speaking, yes, you can place smarty code in your page or template, and use the assign stuff to do that no problem.

you may even be able to use the image plugin, like this: {image src={eval $pageid}} but I'd try it out.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
tmhai

Re: Content inside Content with smarty

Post by tmhai »

I have attached an example of what Im looking for.

[attachment deleted by admin]
jelle

Re: Content inside Content with smarty

Post by jelle »

Static content belongs in the template or in a html_blob/global content (that gets included in the template). Wrap a div around it and float it to where you want it.
But you've still not made clear to me why/if you want the image or content to be dynamically generated?

Btw Calguy: That method certainly has advantages (only one template to maintain, but wouldn't it confuse your endusers? As far as they are concerned, the template determines how the page looks. If you change a graphic dynamically, you break that assumption.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Content inside Content with smarty

Post by calguy1000 »

I don't know, depending upon the content, and how many people are going to be editing content, putting this smarty syntax in the template could be very valid.

If you could manage to get this to work in the template, anybody writing a new page would simply have to upload an image of the proper resolution with a certain name to the images directory, whilst they were submitting content, and layout would automatically take place properly.

A global content block would definately make this syntax a little easier to understand, or a user defined plugin could go even further.  then just put the tag into the template and, like you said, wrap a div around it, and off you go.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
tmhai

Re: Content inside Content with smarty

Post by tmhai »

Ok, I think were venturing into something else... let me fully re-explain.

I want to place a global content block next to the content of a page, rather than having two seperate coloums I want the content to wrap itself around the global block.

This is what I have in my template:

Code: Select all

			<!-- Content Start -->
			<div id="ad">{global_content name='Ad'}<div id="content">{content}</div></div>
			<!-- Content End -->
This is the CSS:

Code: Select all

#content {
padding: 18px;
text-align: justify;
line-height: 1.4em;
background-image: url(image/shadow_content.gif);
background-repeat: repeat-x;
}

#ad {
float: right;
margin: 20px 10px 0 10px;
}
This is the global content block 'Ad':

Code: Select all

<__script__ type="text/javascript"><!--
google_ad_client = "pub-8235283052338144";
google_ad_width = 180;
google_ad_height = 60;
google_ad_format = "180x60_as_rimg";
google_cpa_choice = "CAAQ24Oy0QEaCGbgW7AaXRokKMu293M";
//--></__script>
<__script__ type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</__script>
With the above code the 'Ad' is wrapped, but it is wrapped in the top right hand corner. My question is how do I make it appear at the bottom right hand corner?

I have tried this, but it doesnt wrap:

Code: Select all

			<!-- Content Start -->
			<div id="content">{content}</div><div id="ad">{global_content name='Ad'}</div>
			<!-- Content End -->
Locked

Return to “Layout and Design (CSS & HTML)”