Jump to content

Archived

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

rsmm

How to insert markup before or after a Canvas area

Recommended Posts

rsmm

Is there any way to insert arbitrary markup before or after a canvas area? I really need a hook or a filter or something... some way of accomplishing this. I'd really like to accomplish this with PHP, rather than javascript. Though I don't think I'm quite savvy enough to tear through the section caching code to figure it out. 

 

One of my goals is to insert fancy dividers between bands of content. It would also allow the insertion of buttons

 

Any help would be greatly appreciated. Thank you.

 

 

Share this post


Link to post
Share on other sites
Danny

Hi,

 

If you want to include borders, why not just use CSS ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
rsmm

If I could use pure CSS I would. Unfortunately, what I am need to achieve is a bit more complex that what can be achieved with the two pseudo element limitation, and cannot be accomplished with CSS.

Share this post


Link to post
Share on other sites
Danny

I would need to see an example of what is it you're trying to achieve, can you provide a concept image please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
rsmm

Sure. Here's a Codepen I created to test out different separator / divider styles. A couple of the styles use SVG images that are placed between the .pl-area sections. Having them parallel to the section allows the use of CSS sibling selectors to easily change the positioning and color as necessary in very dynamic ways.

 

This is one example of the kinds of things I would like to be able to do.

 

There are two ways I can see this functioning:

 

1) A filter or action hook that returns info about the section, so you can programmatically choose which section to hook into based on it's ID. This might be useful in some circumstances. Though I don't know enough how about how section IDs work to know if that's a solid option. Using IDs seems very limiting.

 

2) A class based approach. The most useful and efficient method I can think of is the addition of an action hook or filter that allows you to target canvas areas based on what theme they have selected. Since version 2.0.5, with the inclusion of the pl_theme_classes filter, you can arbitrarily set themes in the dropdown that is assigned to a canvas area. If you could intercept calls to sections that use a specific class, you could target canvas areas as groups, to easily make rapid changes throughout the entire site, instead of having to go through every single page that uses that style of canvas/section.

 

I'm currently working on a styling system that sits on top of DMS for internal use within my company. For our sites, we need the ability to rapidly style a site globally, rather than on a page by page basic. 

 

Any help or insight you could offer into how to tap into the markup output of a section based on which theme it has selected would be greatly appreciated. Heck, maybe this functionality already exists, and I'm just not wise enough to figure it out. Perhaps this is impossible, and my request is ridiculous. You tell me :)

 

Either way, thanks for your time.

Share this post


Link to post
Share on other sites
Danny

I will need to test this myself, I still can't see why this can't be done via CSS. However, see as you already have the code you wrote via CodePen, why not just create your own sections ?

In doing so, you can therefore, just drag and drop them for quicker styling, rather than having to use CSS for different sections if that makes sense.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • jeomiland
      By jeomiland+
      Hi guys
      Hopefully an easy question. I have some custom code included in a Next section in a DMS site that I'm converting to platform5. What is the easiest way to insert my code into a "section" which I can easily add to my page structure with the platform5 page editor? I have the Embed extension but that takes javeascript, and my PHP test failed. Also have the Shortcodes extension, but looks like that only inserts objects into the WP-loop? and again, how to create a Hook that can go here?
      thanks...
    • KathleenAspenns
      By KathleenAspenns+
      I would like to upgrade my site to PHP 7, but there is an error warning in the PL Framework theme. I should think this should be fixed asap, I cannot be the only person trying to be up to date.
      1976 | ERROR | preg_replace() - /e modifier is deprecated since PHP 5.5 and removed since PHP 7.0
       
    • Dan Haddock
      By Dan Haddock
      DMS: Latest Version
      Running a Child Theme
      Wordpress: 4.8.3
      Plugins:
      Akismet Anti-Spam 
      Coming Soon Page & Maintenance Mode by SeedProd
      Contact Form 7
      Cookie Law Info
      DMS Professional Tools    
      Enhanced Media Library
      Flamingo
      Google Analytics for WordPress by MonsterInsights
      Google XML Sitemap    
      Jetpack by WordPress.com
      Legull
      Loginizer   
      MailChimp for WordPress
      PageLines Updater
      Really Simple SSL
      Schema App Structured Data
      Sucuri Security - Auditing, Malware Scanner and Hardening  
      Uber reCaptcha
      Yoast SEO
      Problem Below
      Hi Team,
      I am looking to style the Continue Reading Button with the PHP you provided in an earlier ticket here: 
       
      I put the PHP code into my site, however I do not get my Icon back, I just get back Read More >>
      I have attached a screenshot of the code in place on my site along with the output.
      Interested to know what I may be doing wrong? - I am very new to PHP so a bit apprehensive on this.
      The Images: https://drive.google.com/open?id=0B0i4JJXa2jdQN2xoakZNRUdmaU0
      Let me know if you need any more information from me.
       
    • casseysdesigns
      By casseysdesigns+
      In the past I would use nextbox for this task. However, Platform 5 does not have nextbox. I will do my best to describe what I am trying to do.
      I am creating a template for coaches, each product has its own link but they all share a common coach id. I want to set up the templates with the links for each product with a variable for the coach id so that I can change the coach id for all the links on the site by just changing the value of the variable $coachId. To do this I'll need to do something like the following...
      <a href="salesite.com/productcodes/referringRepId=<?= $coachId ?>" target="_blank">Product Purchase Link</a> Is it possible to do this with Platform 5?
    • 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
×