Jump to content


Photo
- - - - -

Custom Templates and Custom Sidebar Sections


  • Please log in to reply
22 replies to this topic

#1 myohanan

myohanan

    Advanced Member

  • Members
  • 64 posts

Posted 08 December 2011 - 08:49 PM

Agh. This upgrade destroyed everything I had built.
All of my custom page templates and custom sidebar sections are gone.

I downloaded the custom sections plug-in. The documentation within this plugin is not very detailed on how to recreate my templates and sections.

For the Templates:

// ---- ADDING NEW TEMPLATES ---- //

Want another page template for drag and drop? Easy :)
1. Add File called page.[page-id].php to this folder.
2. Add Template Name: Your Page Name to that file ( see page.base.php for an example. )
3. Thats it! We do the rest for you!

This process looks the same as PlatformBase, minus having to register the section in the function.php file. When I do create these new files in pagelines-customize folder, the templates are not automatically created in either the pagelines admin section or in the edit page section. What am I missing?

For example I have a file titled page.contact.php with this inside:

Please Login or Register to see this Hidden Content



For the new Sections:

// ---- ADDING NEW SECTIONS ---- //

Adding new sections is really easy in 2.0
1. Copy your section.[sectionname].php file into the sections folder
2. It will be auto loaded for you.
3. You can now enable/disable the section in the extensions menu.


I am trying to just copy all my sidebars over because I had created many.

For example in the pagelines-sections folder I copied my file section.sb_employeepics.php

It contains:

Please Login or Register to see this Hidden Content


No section is created when I add this.

For now, I have reverted back to Platformpro with Base.

Please let me know what I should be doing or create more detailed documentation on the subject. Thanks!

#2 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 08 December 2011 - 11:01 PM

I recommend watching the video tutorials here:

Please Login or Register to see this Hidden Content

It gives a very detailed step-by-step process on making your own sections.

#3 myohanan

myohanan

    Advanced Member

  • Members
  • 64 posts

Posted 09 December 2011 - 03:13 PM

Thanks for the response Kastelic. Are there any samples available? I'm not a developer and built most of my duplicate sidebars by recreating the given base sidebar sample in platformbase. Also, any idea on what I'm doing wrong with new templates? Michael

#4 catrina

catrina

    Advocate

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

Posted 09 December 2011 - 04:59 PM

Have you seen this video?:

Please Login or Register to see this Hidden Content

I don't see anything wrong with your templates.

#5 myohanan

myohanan

    Advanced Member

  • Members
  • 64 posts

Posted 09 December 2011 - 05:08 PM

AH! I was missing the pagelines section template. I'll use that now as a guide.

#6 myohanan

myohanan

    Advanced Member

  • Members
  • 64 posts

Posted 09 December 2011 - 05:49 PM

Yes, yes, yes! I figured out the sidebar cloning, thank you. I just needed a push in the right direction.

In case anyone needs their hand held as well, watch that video.

But basically, if you want to clone a sidebar - after you download the pagelines-section-template, duplicate it and save it in the pagelines-section folder (both are within the wordpress plugin area after you download them from the pagelines store, not in the theme area). Then within the duplicated and renamed template folder delete all the code in the section.php file and replace it with:

Please Login or Register to see this Hidden Content


Making sure to rename every instance of PrimarySidebar to whatever you want to call your new sidebar. Then go to the pagelines store in your wordpress admin and make sure the new sidebar section is activated!

#7 myohanan

myohanan

    Advanced Member

  • Members
  • 64 posts

Posted 09 December 2011 - 06:08 PM

Catrina, sorry, one last question. Still can't figure out why my templates aren't appearing.

In pagelines-customize (the plugin I downloaded to make function.php and style.css changes), I have created a number of files with the naming structure of

Please Login or Register to see this Hidden Content


Then, within that File:


Please Login or Register to see this Hidden Content



#8 jcritty

jcritty

    Advanced Member

  • Members

  • 80 posts
  • Country: Country Flag

Posted 12 December 2011 - 01:31 AM

I too am stumped by this. I've done the exact things described in the plugin file and yet no templates exist!

Please Login or Register to see this Hidden Content



#9 myohanan

myohanan

    Advanced Member

  • Members
  • 64 posts

Posted 12 December 2011 - 08:14 PM

What about the templates? Not being able to create new custom templates is killing me. The direction in the customize plugin do not seem to be working. Please help.

#10 michaeljaekel

michaeljaekel

    Member

  • Members

  • 14 posts
  • LocationTrier
  • Country: Country Flag

Posted 11 January 2012 - 02:19 PM

@myohanan Hi, Just in case you didn't resolve your problem: please double check that you created your new page file in ../wp-content/plugins/pagelines-customize/[new page file] instead of ../themes/pagelines/[new page file] After moving my file to that correct directory the new page template was shown at the admin.

#11 tpldrew

tpldrew

    Advanced Member

  • Members

  • 93 posts
  • Country: Country Flag

Posted 14 January 2012 - 01:36 PM

I too have added a template to the ../wp-content/plugins/pagelines-customize/[new page file] but it's not showing up in my "special" admin section. I'm hoping to spend time with setting up the pagelines 2.0 new site this weekend any guidance would be greatly appreciated. Specifically, do I need to add anything to functions.php to register the page?

#12 krnlhkr

krnlhkr

    Newbie

  • Members
  • 4 posts

Posted 15 January 2012 - 07:07 AM

Yes, I'm having the same problem with templates that tpldrew, jcritty, and myohanan are having. In fact, after I install the customize plugin, I'm not even seeing the default "Custom Page" template that should show up under templates let alone my own. I pretty much need this functionality for the site I'm working on, so any advice would be great. WP 3.3.1 with PageLines Framework 2.0.1. If it helps, it's shared hosting that doesn't use suexec, but it doesn't seem like a perms problem. Thanks! Edit to add: Just found out if I drop my page.base.php file into wp-content/themes/pagelines it is picked up, but not under the customize folder, so something is apparently busticated with the customize plugin and custom page templates.

#13 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 15 January 2012 - 07:54 AM

It isnt 'busticated' as you put it lol. The plugin will only copy the page file to the active theme, be it a child o parent IF it has permissions to do so, if not it just wont. So if this is the case, just put the page file into your child/parent theme folder.

#14 krnlhkr

krnlhkr

    Newbie

  • Members
  • 4 posts

Posted 15 January 2012 - 08:06 AM

Well, I think that it is busticated. ;-) I'll tell you why. According to the customize plugin I should just be able to drop a page template under wp-content/plugins/pagelines-customize, right? And then it should be picked up. Say I have a page template page.home.php If I put my page template *only* under: wp-content/themes/pagelines It doesn't show up in page lines control under templates. If I put it *only* under: wp-content/plugins/pagelines-customize/ Same thing, it doesn't show up. But if I put it under *both* it shows up and the name in the comment is pulled from the wp-content/themes/pagelines version. It *seems* like it is getting the list of files from wp-content/plugins/pagelines-customize/ but trying to pull the content for those files from wp-content/themes/pagelines Maybe something is using the wrong path to include the file and the right path to get the list of files? The problem doesn't happen with function.php; that's pulled in correctly from the pagelines-customize subdir. It's only the page templates that are having a problem.

#15 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 15 January 2012 - 08:11 AM

Yes, it does have to be in both to show up, sorry lol. The templates are scanned in the customize folder and if it can copy it, it moves it to the theme folder, if its successful it will be registered into the framework for use. Wordpress will only read templates from the theme folder, no way around this.

#16 krnlhkr

krnlhkr

    Newbie

  • Members
  • 4 posts

Posted 15 January 2012 - 08:15 AM

Ah OK. Now it makes sense :-) But that's kind of a problem for shared hosting. The files are owned by my ftp account but the server runs as "nobody" so the server can't copy files over unless I chmod everything to 777, which I don't want to do in my pagelines theme directory for obvious reasons. Some hosts use suexec so the server runs as the FTP account, but some don't. I got "lucky" and have one that doesn't. That's why I have to type in my FTP info when I install stuff, sigh. So for those of us in this situation, we should just put the page template in both places? Thanks, I appreciate the help!

#17 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 15 January 2012 - 08:27 AM

Yes you should, and you should ask your host why you do not own your own files, bear in mind that all sites on the server will be owned by the webserver, so you could read any file in anybodies webroot including sensitive config files!

#18 krnlhkr

krnlhkr

    Newbie

  • Members
  • 4 posts

Posted 15 January 2012 - 08:40 AM

OK, thanks, Simon.

Oh I think you misunderstood me. The files are owned by me. But the apache server runs as "nobody" so when it runs the .php code, it doesn't have permissions to write in my directories via the php.

suexec tells the apache server to run as me so when the php code is executed, it does have permissions to write in my directories.

WordPress actually has a buried document on this exact issue, here:

Please Login or Register to see this Hidden Content



Thanks again for the help! I'm up and running again. :)

#19 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 15 January 2012 - 08:52 AM

suexec is for perl scripts not php ;) Your scripts are running as nobody trust me, thats why you have to set them 777 to allow nobody to write to your files. How to test, create a simple php script in your home folder, use file_put_contents( 'hello.txt', 'abc' ); it should create the file hello.txt, see who owns the file, my bet it will be nobody! BTW you wont be able to delete the file then because it will be ownded by apache, you will have to use phps unlink() to delete it.

#20 devaldivia

devaldivia

    Advanced Member

  • Members
  • 34 posts
  • Country: Country Flag

Posted 27 March 2012 - 01:06 PM

I wanted to create a new sidebar, followed the instructions as per: myohanan , and it worked perfect! I know, just got lucky :) but still, wanted to say Thank You!