Jump to content


Photo
- - - - -

Hot to Add a Custom Sidebars

add custom sidebar

Best Answer Danny , 30 January 2013 - 11:43 AM

I followed the instructions and have a new sidebar on my test site.

 

I created a sidebar called Blog, I have pasted the code I used below, you can use this to see what went wrong with yours.

 

http://paste.pagelines.com/9zo

Go to the full post


  • Please log in to reply
13 replies to this topic

#1 benz_admin

benz_admin

    Advanced Member

  • Members
  • 65 posts
  • Country: Country Flag

Posted 19 January 2013 - 12:34 PM

Hi to all,

I try to follow this istruction

Please Login or Register to see this Hidden Content

but:

 

- I can't find the Sidebar Prority option

Please Login or Register to see this Hidden Content

on Dashboard>Pagelines>Site Option>Advanced

- on Appearence>Widget my custom sidebar doen't appear

 

How can I solve it?

thanks



#2 benz_admin

benz_admin

    Advanced Member

  • Members
  • 65 posts
  • Country: Country Flag

Posted 19 January 2013 - 12:34 PM

ps. I have a Pro license!



#3 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 21 January 2013 - 11:05 PM

Buongiorno Michel,

 

I'm unsure why you do not see the Enable Priorities option.  Could you tell me which version of PageLines Framework you are using?  You can find out at Dashboard  Appearance > Themes

 

Enabling priorities though will only sort the order of widgets in the sidebars, making sure they do not become disorganized.  If they do, the solution is simply to move them up or down between sidebars to place them back where they belong.  So, the priorities are not critical or have anything to do with creating the custom sidebar.

 

Beyond the issue of enabling the priorities, did you implement anything else in the instructions for creating custom sidebars?



#4 benz_admin

benz_admin

    Advanced Member

  • Members
  • 65 posts
  • Country: Country Flag

Posted 22 January 2013 - 08:04 AM

Ciao Rob, :)

my pagelines framework version is 2.3.8.

 

I just followed the Custom Sidebars guide....

Please Login or Register to see this Hidden Content

So:

- I created a new folder via FTP in public_html/wp-content/themes/pagelines/sections and I renamed It sb_custom

- I created a section.php file and I put it into the new folder

- I copied a icon.png file from another sidebar

 

this is the php file content:

 

class MyCustomSidebar extends PageLinesSection {
   function section_template() {
         pagelines_draw_sidebar($this->id, $this->name, '');
    }
}



#5 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 22 January 2013 - 03:22 PM

Do you need further assistance with sidebars?



#6 benz_admin

benz_admin

    Advanced Member

  • Members
  • 65 posts
  • Country: Country Flag

Posted 27 January 2013 - 08:43 PM

yes please!!

on my latest post I described what I have done, but it doesn't work!



#7 smv_usdam

smv_usdam

    Member

  • Members
  • 21 posts
  • Country: Country Flag

Posted 28 January 2013 - 09:05 AM

Hi,

I'm using pro version 2.4.

I also can't find the sidebar priority option mentioned. It's not there. Maybe it used to be there in earlier versions ?

I also followed the custom sidebars guide in the wiki quoted above, but I created the new folder in /plugins/pagelines-sections/ instead of /themes/pagelines/sections and I used the whole code provided in the wiki for sections.php:

 

 

class MyCustomSidebar extends PageLinesSection {

/** PHP that always loads no matter if section is added or not. */
function section_persistent() {
$setup = pagelines_standard_sidebar($this->name, $this->settings['description']);
pagelines_register_sidebar($setup, 100);
}

/** Section template. */
function section_template() {
pagelines_draw_sidebar($this->id, $this->name, '');
}
}

 

 

This worked for me.

It might be because of the part "pagelines_register_sidebar" etc. which for some reason unknown to me is missing in the current core pagelines sidebar section.php files.

 

Hope this helps ;-)



#8 benz_admin

benz_admin

    Advanced Member

  • Members
  • 65 posts
  • Country: Country Flag

Posted 28 January 2013 - 10:30 AM

Thanks for your help Newbie,

I tryed to follow your instruction but it doesn't work for me!

I empty the browser cache and re-open Dashboard>Appearance>Widget but i don't find any new sidebar.

 

Have I to do anything else?



#9 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 29 January 2013 - 03:21 AM

Buona notte,

 

The custom section, if you followed the instructions carefully here:

Please Login or Register to see this Hidden Content

may not appear in Dashboard > Appearance > Widgets if you did not place it into a template.  WordPress doesn't know it exists.

 

How did you edit/create the section?  Could you provide us a step-by-step list of what you did?

 

Mille grazie!



#10 benz_admin

benz_admin

    Advanced Member

  • Members
  • 65 posts
  • Country: Country Flag

Posted 29 January 2013 - 10:51 AM

This is what i have done:
- I created a new folder called sb_custom in wp-content/themes/pagelines/sections
- I copied a icon.png file from another sidebar and I inserted it into the folder
- I inserted into this folder a section.php file

 

this is the php file content:

 

<?php
/*
    Section: Custom Sidebar
    Author: PageLines
    Author URI:

Please Login or Register to see this Hidden Content


    Description: The main widgetized sidebar.
    Class Name: CustomSidebar    
    Workswith: sidebar1, sidebar2, sidebar_wrap
    Persistant: true
*/

/**
 * Custom Sidebar Section
 *
 * @package PageLines Framework
 * @author PageLines
*/
class CustomSidebar extends PageLinesSection {

    /**
    * Section template.
    */
   function section_template() {
          pagelines_draw_sidebar($this->id, $this->name, 'includes/widgets.default');
    }

}

 

This is exatcly what I have done!



#11 Danny

Danny

    Is Awesome!

  • Moderators
  • 17653 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 29 January 2013 - 01:08 PM

I haven't tested this personally but I think you may have uploaded the section to the wrong location,

 

instead of:

 

wp-content/themes/pagelines/sections/

 

upload it here;

 

wp-content/plugins/pagelines-sections/

 

and see if that resolves your issue.



#12 benz_admin

benz_admin

    Advanced Member

  • Members
  • 65 posts
  • Country: Country Flag

Posted 30 January 2013 - 11:31 AM

smv_usdam said it to me on 28 January and I tryed it but it didn't work.

 

can you confirm that the only steps to do are these that I described on this post?

 

This is what i have done:
- I created a new folder called sb_custom in wp-content/themes/pagelines/sections
- I copied a icon.png file from another sidebar and I inserted it into the folder
- I inserted into this folder a section.php file

 

this is the php file content:

 

<?php
/*
    Section: Custom Sidebar
    Author: PageLines
    Author URI:

Please Login or Register to see this Hidden Content


    Description: The main widgetized sidebar.
    Class Name: CustomSidebar    
    Workswith: sidebar1, sidebar2, sidebar_wrap
    Persistant: true
*/

/**
 * Custom Sidebar Section
 *
 * @package PageLines Framework
 * @author PageLines
*/
class CustomSidebar extends PageLinesSection {

    /**
    * Section template.
    */
   function section_template() {
          pagelines_draw_sidebar($this->id, $this->name, 'includes/widgets.default');
    }

}

 

This is exatcly what I have done!

 

the custom sidebar should appear on Appearance>Widget on the right sidebar list?



#13 Danny

Danny

    Is Awesome!

  • Moderators
  • 17653 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 30 January 2013 - 11:43 AM   Best Answer

I followed the instructions and have a new sidebar on my test site.

 

I created a sidebar called Blog, I have pasted the code I used below, you can use this to see what went wrong with yours.

 

Please Login or Register to see this Hidden Content



#14 netage

netage

    Super Member

  • Members
  • 114 posts
  • Country: Country Flag

Posted 11 March 2013 - 10:52 AM

Thank you, it worked.

 

Regards,

Cait