WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Row between every new section created?
  • Print
Pages: [1]   Go Down

Author Topic: Row between every new section created?  (Read 4161 times)

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Row between every new section created?
« on: October 06, 2013, 06:50:05 PM »
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
Logged

jacobi22

  • Guest
Re: Row between every new section created?
« Reply #1 on: October 06, 2013, 06:59:31 PM »
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
Logged

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: Row between every new section created?
« Reply #2 on: October 06, 2013, 07:15:19 PM »
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
Logged

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: Row between every new section created?
« Reply #3 on: October 06, 2013, 07:43:00 PM »
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
Logged

jacobi22

  • Guest
Re: Row between every new section created?
« Reply #4 on: October 06, 2013, 10:40:18 PM »
Quote
Is this possible?

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: [Select]
// Loop through them and include their module fileput a new line behind this line 300 and set the counter to 1

Code: [Select]
$section_count_id = 1;
in (the new) line 311 you have the anchor-code
Code: [Select]
if(defined('SEC_ANCHOR') && SEC_ANCHOR!='') {
                                        echo '<a class="section_anchor" id="'.SEC_ANCHOR.$section_id.'" name="'.SEC_ANCHOR.$section_id.'"></a>';
                                }

i built a new class anchor... behind this section_anchor
Code: [Select]
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>';
                                }

in line 330 you found this code here
Code: [Select]
echo search_highlight($content, $arr_string);
                                } else {
                                        echo $content;
                                }

change the code with these lines here
Code: [Select]
echo search_highlight($content, $arr_string);
                                } else {
                                        echo $content;
                                }
                                $section_count_id++;

now you have a new anchor in the frontend-source-code, but with other id and names
Code: [Select]
<a id="wb_19" class="section_anchor anchor1" name="wb_19"></a>
 and you can use the class "anchor1" in your css
like this
Code: [Select]
a.anchor1{display:none;}

Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Row between every new section created?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2