AFTER I FOUND A BETTER WAY OF DOING THIS I CHANGED THIS FIRST POST
This basically means that some things in relies sometimes refer to items that ahve since been corrected. There are some people who replied to this thread that worked their way through the various stages of this code and finally got it working.
thanks peeps.
#####################################
Problem:
Fragments, products and sections dont want to go where you put them. There is a distinct lack of control over the positioning of certain elements in Actinic.
Setting it up:
First, add this to your actinic extras js file at the bottom
and at the footer of your main template, just before the ans /body tag:
now, create a fragment template, and put this minimal example in it:
Now, somewhere in your design, either in a primary template, or anywhere where this code will appear ONLY ONCE, paste this container div:
how does this work?
The container elements can be anywhere, and their ID gives them something unique to latch onto. They need to be empty, so that later on, we can fill them up, by moving content into them. In this example, I have used a single div, with the id of 'topbits'. Yours can be called anything, and can be anywhere, so long as it appears in your page only once.
The block you want to shift needs to have a wrapper around it, with some attributes to tell it where to shift to.
in this case mine looks like this:
look closely at the class of this div. It's called 'movethis'. This tells the script earlier, to take the contents of this wrapper div and move it somewhere else.
but where? to the location in the title attibute. and in this case, its going to append the contents of itself to a div called 'topbits'. The div then empties itself.
Move complete!
Now whats good about this, is that you can have any number of target containers. They can be in your footer, header, sidebars, above your innercontent, or below it.
And this isnt limited to fragments either. You can move sections too. just enclose anything you want to move with the wrapper div and set its title tag to your target.
A warning:
This is a javascript technique and as such cannot help you with your SEO. A search engine cannot see the locations you choose, it only sees the original order that actinic puts the items in the page. too see what I mean, turn off javascript in your browser and reload the page.
This basically means that some things in relies sometimes refer to items that ahve since been corrected. There are some people who replied to this thread that worked their way through the various stages of this code and finally got it working.
thanks peeps.
#####################################
Problem:
Fragments, products and sections dont want to go where you put them. There is a distinct lack of control over the positioning of certain elements in Actinic.
Setting it up:
First, add this to your actinic extras js file at the bottom
HTML Code:
function makeitso() { //make an array of all the divs on this page. MoveUs = document.getElementsByTagName("div"); //loop all the divs. for( var i = 0; i < MoveUs.length; i++ ) { //only if it has the class 'movethis' if (MoveUs[i].className=="movethis") { ThisItem = MoveUs[i] //get the html from inside this div temp = ThisItem.innerHTML; //where is it going? document.write (ThisItem.title); //empty the old div ThisItem.innerHTML = ""; //append it to the end of the target div, found in the rel attribute document.getElementById(ThisItem.title).innerHTML = document.getElementById(ThisItem.title).innerHTML+temp; } } }
HTML Code:
<script>makeitso();</script>
HTML Code:
<div id="<actinic:variable name="FragmentAnchor" />" class="movethis" title="topbits"> <h1 class="subheading"><actinic:variable Name="FragmentTitle"/></h1> <p><actinic:variable Name="FragmentText"/></p> </div>
HTML Code:
<div id="topbits"></div>
The container elements can be anywhere, and their ID gives them something unique to latch onto. They need to be empty, so that later on, we can fill them up, by moving content into them. In this example, I have used a single div, with the id of 'topbits'. Yours can be called anything, and can be anywhere, so long as it appears in your page only once.
The block you want to shift needs to have a wrapper around it, with some attributes to tell it where to shift to.
in this case mine looks like this:
HTML Code:
<div id="<actinic:variable name="FragmentAnchor" />" class="movethis" title="topbits"> <h1 class="subheading"><actinic:variable Name="FragmentTitle"/></h1> <p><actinic:variable Name="FragmentText"/></p> </div>
but where? to the location in the title attibute. and in this case, its going to append the contents of itself to a div called 'topbits'. The div then empties itself.
Move complete!
Now whats good about this, is that you can have any number of target containers. They can be in your footer, header, sidebars, above your innercontent, or below it.
And this isnt limited to fragments either. You can move sections too. just enclose anything you want to move with the wrapper div and set its title tag to your target.
A warning:
This is a javascript technique and as such cannot help you with your SEO. A search engine cannot see the locations you choose, it only sees the original order that actinic puts the items in the page. too see what I mean, turn off javascript in your browser and reload the page.
Comment