Edit page - Add text above tab/pill content, link to tab/pill

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
philmills
User
Posts: 555

Edit page - Add text above tab/pill content, link to tab/pill

Post by philmills »

I have two issues to resolve with an edit page with three pills (I can use tabs instead if it helps).

  1. I would like to add some explanatory text within the second tab, above the first edit field.
    Usually if I want to add text, I would place $this->PreviousField->CustomMsg .= "my text"; which adds text below the previous field. But since I am using pills/tabs this text would appear at the bottom of the previous tab, which isn't useful. How can I add it below the tab?

  2. Is there a way to link directly to a specific tab on the edit page? Or to set a certain tab as "selected" by default?


philmills
User
Posts: 555

Post by philmills »

I have a solution for issue 1

added this to css

#tab_Distribution_Plan2::before {
	display: block;
  content: 'Here's the explanatory text ';
  padding-bottom: 20px;
}

Ideally I would like to use language vars in the content though...


arbei
User
Posts: 9384

Post by arbei »

Your link should contains page index and you may then set the active page by JavaScript, see Startup Script -> Example 4.


philmills
User
Posts: 555

Post by philmills »

I got it figured out.

I added ?wizard=1 to the url (hyperlinked from a list_options button)
then added this to Startup Script for the edit page:

		<?php 
		if (isset($_GET["wizard"])) { ?>
		$(function() {
		currentForm.multiPage.togglePage(1, false); // Hide the 1st page
		currentForm.multiPage.togglePage(3, false); // Hide the 3rd page
		});
		<?php }?>

Works perfectly!


Post Reply