Jump to content

Archived

This topic is now archived and is closed to further replies.

kicksev

new section not visible in 'add-to-page' section list

Recommended Posts

kicksev

Hello,

 

to find out how to create my own section, I put an empty submap  in the dms sections map. Although empty, the name of this map was shown in the 'add-to-page' section list. I removed the map and created a new map with a section.php file as described in  http://docs.pagelines.com/developer/section-api, but it did not show up in the list of section in DMS2. I removed the section.php file, not the submap, but still no new section was shown in the list.

 

What do I do wrong?

 

 

 

Share this post


Link to post
Share on other sites
Danny

Hi,

 

I apologise, but I am not sure what you mean when you say "I put an empty submap  in the dms sections map. Although empty, the name of this map was shown in the 'add-to-page' section list.". Can you provide more information and a screenshot of your directories via an FTP client so we can see what you have added.

 


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
kicksev

Hi Danny,

 

Thanks for your quick reaction.

 

while studying http://docs.pageline...per/section-api, I created an empty map called 'maakeenpraatje' in In public_html/maakeenpraatje/wp-content/themes/dms/sections. After that there was a new section in the section list 'add-to-page'. I was surprised that it only needed an empty map to show up as  section in the section list. because i wanted another name, i removed the map through ftp and i removed the section from the list by the delete button. through FTP I created another map called ‘kick’ which did not show up in the section list. then I created another map called 'kick2'in the public_html/maakeenpraatje/wp-content/themes/dms/dms/sections. This new map  did not show up either. I created a section.php into both maps, but they still did not appear as sections in the list.Can you put me back on the road?

 

I have attached 2 screenshots.

 

gr.,

Kick

 

Share this post


Link to post
Share on other sites
kicksev

I have just added a setup.php file in the map 'kick':

/*
    Section: kick
    Author: Kick Severius
    Author URI: http://www.maakeenpraatje.nl
    Description: zelf gebouwde sectie om php code aan pagina toe te voegen
    Class Name: kick
    Filter: component
    Loading: active
*/

 

no section is shown in the list but in the head of the Wordpress Dashboard is a line, which the description from the sections.php as you can see in the attached file.

 

Do you know what this means?

 

gr.,

Kick

Share this post


Link to post
Share on other sites
Danny

To create your own section, you will need to use a child theme, you should be adding them to the core DMS folder, as when an update is released it will be removed.

 

Also, why are you adding a setup.php file ? The section API documentation states all sections must have a section.php file not setup.php file.

 

I am also not sure what you're referring to when you say "I created an empty Map" ? what is a Map ?

Please be aware that creating a custom section isn't covered by our support. As users who wish to create their own sections should have a full understand on how PHP works.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
kicksev

Hi Danny,

 

I'm very sorry, i come from Windows where they call a folder a map. So please read folder where I wrote map. my second writing error is setup.php. in fact I created a section.php file.

 

I have read before that one should use a child theme, but I could not manage to activate the pl-starter-theme. After pressing 'activate' the screen went blank and stayed blank. I had to remove the pl-starter-theme folder through ftp and activating the DMS theme again. I have tried it several times with the same result, then I stopped trying.

 

I am aware, that support cannot cover the content of a custom section, but I am just trying to find out where to put php code in the pagelines framework.  After a lot of try and error,  I now have a section.php file with a small piece of php code, which works. it is so simple, that I wonder why I had so many problems to get here.

====================

<?php
/*
    Section: Kick
    Author: PageLines
    Author URI: http://www.severius.nl/maakeenpraatje
    Description: my own section
    Class Name: PLKick
    Filter: component
        Loading: active
*/
class PLKick extends PageLinesSection {
    /**
    * Section template.
    */
        function section_template(){
            ?>
            <div class="example">
                    This output HTML would appear on the page wherever the user drops the section.<br>
            <?php print "hello world "; print $this->base_dir;?>
            </div>
            <?php
    }
}

===========================

For the time being, this is what I needed. the file is added in the dms/sections folder.

 

Maybe you have an advise on the activation problem of a child theme so I will be safe for updates.

 

gr.,

Kick

Share this post


Link to post
Share on other sites
Danny

There should be no problem activating the PL Starter theme. Therefore, can you download my Skeleton child theme and see if you encounter the same problem.

 

http://dannyholt.github.io/skeleton/


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
kicksev

activating your skeleton was succesful. I am now using a child theme with my own section and I know how to handle php code in Pagelines, so I am a very happy DMS2 user.

gr., Kick

Share this post


Link to post
Share on other sites
Danny

No problem and thanks for informing us the issue has been resolved.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×