WebsiteBaker Support (2.8.x) > Templates, Menus & Design
Row between every new section created?
(1/1)
Roych:
Hello
Maybe this was already asked but couldnt find it on the forum.
Im trying to create a default row or Image above every new section that I create so that if I have more sections on one page doesnt look like there is no break between them. Like in a blog or something. I have my own img that I wan't to use for that. Is this possible or do I have to put my image manualy everytime?
Now it looks like that:
Text text Text text Text text Text text Text text Text text Text text
Text text Text text Text text Text text
Text text Text text Text text
Text text Text text Text text Text text
Text text Text text Text text
Text text Text text Text text
I want it to look like that (but with image not row)
Text text Text text Text text Text text
Text text Text text Text text
Text text Text text Text text
___________________ ___________________ _______
Text text Text text Text text Text text
Text text Text text Text text
Text text Text text Text text
etc.
Thank you in advance.
Roych
jacobi22:
every section has an anchor with a css-class, called class="section_anchor"
you can use this class in your template-css width a background-image
Roych:
Thank you for your reply
It's working great but now my img is shown 3 times betveen every section like this
Text text Text text Text text
___________________ _
___________________ _
___________________ _
Text text Text text Text text
How do I fix that?
I've looked all over my css but can't see the problem there.
Thank you
Roych
Roych:
Ok, got it ;) It was my CSS had to give it no-repeat ;)
One more question if possible.
I would like that anchor to start from second section only, so that the first one doesnt have it, but second, third etc will.
Is this possible?
Thank you
Roych
jacobi22:
--- Quote ---Is this possible?
--- End quote ---
i think so, but you have to change the code in a core file - not the best solution :roll:
for a test i count the sections in the file /framework/frontend.functions.php
in line 300 (WB Vers 2.8.3. Rev 1638) you found this comment
--- Code: ---// Loop through them and include their module file
--- End code ---
put a new line behind this line 300 and set the counter to 1
--- Code: ---$section_count_id = 1;
--- End code ---
in (the new) line 311 you have the anchor-code
--- Code: ---if(defined('SEC_ANCHOR') && SEC_ANCHOR!='') {
echo '<a class="section_anchor" id="'.SEC_ANCHOR.$section_id.'" name="'.SEC_ANCHOR.$section_id.'"></a>';
}
--- End code ---
i built a new class anchor... behind this section_anchor
--- Code: ---if(defined('SEC_ANCHOR') && SEC_ANCHOR!='') {
echo '<a class="section_anchor anchor'.$section_count_id.'" id="'.SEC_ANCHOR.$section_id.'" name="'.SEC_ANCHOR.$section_id.'"></a>';
}
--- End code ---
in line 330 you found this code here
--- Code: ---echo search_highlight($content, $arr_string);
} else {
echo $content;
}
--- End code ---
change the code with these lines here
--- Code: ---echo search_highlight($content, $arr_string);
} else {
echo $content;
}
$section_count_id++;
--- End code ---
now you have a new anchor in the frontend-source-code, but with other id and names
--- Code: ---<a id="wb_19" class="section_anchor anchor1" name="wb_19"></a>
--- End code ---
and you can use the class "anchor1" in your css
like this
--- Code: ---a.anchor1{display:none;}
--- End code ---
Navigation
[0] Message Index
Go to full version