Cms page, float right

Hey,
I have done as below, but i need it to float: right. how?

"a more elegant way, would be by the way to add it via a "cms page"
1.
in the admin
>>Customer Info>>CMS pages - "Create New Content

Set it to "active"
Title: any title you want
Ident: myownsidebar
Language: Danish
Snippet: x

<div class=“box”>
<h3>Your headline</h3>
<div class=“content”>
<p class=“yourownstyle”>
Your Sidebar content
</p>
</div>
</div>

  1. in the sidebar.tpl (out/azure/tpl/layout/sidebar.tpl)

you just add this line, where you want your content to appear
[{ oxcontent ident=myownsidebar }] "

sidebar is already floating.
or do you want it to float inside sidebar?

“float:right” is a css property,
here you can read more about css:
http://design215.com/toolbox/css_guide.php

its already in the left side, and i want it to be in the right :slight_smile:

have a loot at the template (not the page!) sourcecode, the last line will be something like:


[{include file="base.tpl" sidebar="left"][

set sidebar=“right” instead of “left”

i dont know what you mean with the "template (not the page!) " ? which file would that be then

and thanks a lot for your help :slight_smile:

on which page do you want to have the sidebar on the elft side instead of the rigt side?
generally all templates are stored in the out/theme name e.g. azure/tpl/pages/

so if you want to change the detail page, look into the “details” folder and so on

<i have removed my url> you can see the "Test"box, i want that only on this site/category and i want it on the right.
okay, ill try to look into what you just wrote

Searched in \out\azure pl on my pc and there was only 1 file containing the sentence base.tpl within it, and thats /azure/tpl/page/shop/mallstart.tpl which didnt help adjusting…

edit: There is classes called : sidebarLeft & sidebarRight - how do i choose which one of these classes, it should be used in?

sorry, that should be “page.tpl” not "base.tpl"
the file is: out/azure/tpl/pages/list/list.tpl

Working, thanks a lot :slight_smile:

This works fine, but what if i need all but 1 to be left? how can i make one pages sidebar, floate to the right?
Under the category -> Text, i have the following, but that probably doesnt matter, since its the sidebar i want to have floated to the right:

<div style="border-color:#B4B8B8;border-style:solid;border-width:1px; height:627px"><div class="pageHead" style="text-shadow: 0 -1px 1px #397F90; margin-bottom:0px;">Design selv</div>
[{shirtnetwork action="designer"}]</div>
<br>
[{include file="page/shirtnetwork/designer_description.tpl"}]

you could try to enhance your content.tpl with something like this:


[{if $oContent->getId() == "oxid of the one page you want to have sidebar on the left side"}]
[{assign var name=sidebarposition value="left"}]
[{else}]
[{assign var name=sidebarposition value="right"}]
[{if}]
....
....
[{include file="layout/page.tpl" .. .sidebar=$sidebarposition ... }]

(havent tried if it really works, perhaps you have to replace $oContent with $oView )

Thanks for the replys.
Nothing happens, when i change stuff in /out/azure/tpl/page/info/[B]content.tpl[/B]. I was thinking it should be done in out/azure/tpl/layout/[B]sidebar.tpl[/B] :


[{if $actCategory->oxcategories__oxtitle->value == "Design selv"}]
    <div class="box">
  	<h3>Kort Vejledning</h3>
	<div class="content">
		<p class="yourownstyle">
    		[{ oxcontent ident=myownsidebar }]
   		 </p>
  	</div>
</div>
[{/if}]

or in /out/azure/tpl/layout/[B]page.tpl[/B] :


<div id="content"
[{if $actCategory->oxcategories__oxtitle->value == "Design selv"}] class="contentDesigner"
[{elseif $smarty.get.cl == "marketplace"}] class="contentMarketplace" [{/if}]>
[{include file="message/errors.tpl"}]
[{foreach from=$oxidBlock_content item="_block"}]
[{$_block}]
[{/foreach}]
</div>

Its the "Design “selv” category, which contains the box, that should be shown on the right.

oh… yes, you’re right. It should be category and not content

in this case you can put something like this into the first line of layout/page.tpl:


[if $oView->getClassName() == "alist" && $actCategory->oxcategories__oxtitle->value == "Design selv" }]
[{assign var=sidebar value="left"}]
[{/if}]

<url removed> it doesnt move it on the right side of content and it even makes the content a lot widther, for some reason. but if i use firebug to make it smaller then normal, it still doesnt move it over at the right side. suggestions? maybe content is set to right or something with position, which im very bad at using.

Anyone else who can help?

well, your sidebar ist floating:left and your content is floating left. Next Problem: Your page element is 960px, your content 940px and your sidebar 172px. Make your content something like 748px and see what happens.

see my screenshot. 2 little changes and it works.

Thanks for the reply.
Do you know why how to change the float on only this specific page?
The following isnt working, in page.tpl:

[{if $oView->getClassName() == "alist" && $actCategory->oxcategories__oxtitle->value == "Produktsortiment" }]
[{assign var=sidebar value="right"}]

Before i added the above to float things around, then the css was the below, so i guess its set to just fill out the page and that i dont have to change the width of it, when we get the float part to work, so it will choose the correct width by itself:

div.sidebarLeft #content, div.sidebarRight #content {
    margin-bottom: 15px;
    width: 748px;

well, your code seems to work proper. class=“sidebarright” is added correct (see screenshot)
Have you tried it with the original azure-template?

You can test it here http://oxid-tpl-debug.stahlwarenhaus-hebsacker.de/azure/Bekleidung/
Open your developer-tools and change the page class from sidebarleft to sidebarright - works excellent. Maybe you have made some other changes to your css or your templates that causes these error?

Edit: class=“sidebarleft” also doesn’t work on your page.