Jump to content
casseysdesigns

Php Execution (Nextbox for Platform 5)

Recommended Posts

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?

Share this post


Link to post
Share on other sites
casseysdesigns

Hi Simon,

Thank you for getting back to me. I did play with the pagelines shortcodes but of course they aren't set up to do what I am trying to since its probably not a really common need. To be honest I have never messed with shortcodes much other than pre-made ones and that is me being lazy and refusing to step outside my comfort zone. I am looking into the article you referenced to learn how to create them. 

Thank You! 

 

Share this post


Link to post
Share on other sites
casseysdesigns

Update!

So, a little research and experimenting and I found that a custom shortcode is exactly what I needed for what I want to do. Thank you very much for the article. The following is what I used to make this work and now all I will have to do is change the id and its ready to go for a new coach :) 

Shortcode Function 

//Create function for shortcode to create global Referring Coach Id links.
add_shortcode ('coachId', function($atts) {
	$atts = shortcode_atts(
		array(
			'src' => '',
			'target' => '_blank',
			'class' => '',
			'cta' => 'Order Now'
 		), $atts);
		
	return '
	<div>
	<a href="' . $atts['src'] . 'referringRepId=212594" target="' . $atts['target'] . '" class="' . $atts['class'] . '">' . $atts['cta'] . '</a>
	</div>';
	
});

Shortcode in Wordpress Content

[coachId src="https://salesite.com/signup/" cta="Become a Coach"]

 

Hope this helps someone out! I'm off to see what else I can learn!

Thanks Again Simon!!

Share this post


Link to post
Share on other sites
Simon

I told you it was easy ;)

  • Like 1

Share this post


Link to post
Share on other sites
jeomiland

Hey guys

Really appreciate this thread and article. Will be experimenting with it.

However, does this set up an issue with Wordpress core software updates? For themes, it's recommended to create a child theme for this very reason. Does the wp-includes/shortcodes.php. get wiped out with WOrdpress updates? How to handle this. Seems sort of cludging to have to go in and reinstall code after updates?

thanks

 

Share this post


Link to post
Share on other sites
Aires

Hi , your child theme should have a functions.php file and everything should be ok.

  • Like 1

ndTgvai.jpg

Visit iheartpagelines.com for the latest tutorials on PageLines related products.

 

Share this post


Link to post
Share on other sites
jeomiland

thanks...

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • 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.
       
    • Jared Smith
      By Jared Smith+
      I'm using the Impulse section for a screen wide image. I'm seeing a funny thing though, whenever I turn off the page editor, all the impulse section pictures disappear.  It has been saved.  Any ideas.  I can send you login links if need be.
      With Editor ON (note, no save button)
      you can see the waterfall image
       
      When I turn editor off, it goes away
       
      Any suggestions?


    • oseehys
      By oseehys+
      Hello There,
      So i want to use platform 5 and DMS sections on a single page, i am using a child theme with pinspro as my main theme and i activated platform 5, the only problem am having so far is the fixed option, my navbars are not aligning to their default size, and it will be great if platform 5 header and footer section will function, has anyone used this option, how can i make the best use of platform 5 and DMS on a site
      Cheers
×