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    1
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    1,327
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    1
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    1,327
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    1
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    1,327
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

    • 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
    • janpeeters
      By janpeeters+
      I read a lot lately about how much faster PHP 7 is than older versions. Is PL5 compatible with 7?
      Does anyone have experience with running their whole PL5 site on PHP 7? Would love to hear your experiences.
      Thanks, Jan
    • 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.
    • dymond
      By dymond+
      I've been trying to upload a video to use as a video background, but the size was 12m, and the alotted max file size is 8m. I downloaded a couple of pugins that increase the size by creating php.ini files and all of that jazz, but to no avail. It would say (Max file size = 250mb) but after I uploaded I would get an "HTTP ERROR",
      Soooo I logged into my cpanel and saw that the php I was using was 4 version out of date. I upgraded my php to PHP 5.6 and now I get
      Fatal error: Out of memory (allocated 39583744) (tried to allocate 15 bytes) in /homepages/39/d200014696/htdocs/dymondentertainment.com/wp-content/themes/dms/dms/includes/less.plugin.php on line 848
      When I activiate another theme that is not pagleines, the site works fine.... but will no longer work with Pagelines DMS Version 2.2
       
      My site has no gone dark. What can I do?
×