Displaying Different Shack Forms for Different Pages

Displaying Different Shack Forms for Different Pages

One of the questions we had from a customer last week was how to display different Shack Forms on different pages. Shack Forms is a very popular Joomla extension for building forms. Once you install it on your Joomla site, you will have a default Shack Forms module. But what if you would like to have different forms for different pages?

This can be easily achieved by duplicating the default module. You then customize each of the duplicated modules as you see fit to meet your Joomla site requirements. In this blog post, I will show you how to do that.

Once you install the Shack Forms Pro on your Joomla site, you will have one Shack Forms Pro module installed:

shack forms pro module installed by default

Sometimes you may want to display different Shack Forms for different pages of your Joomla site. You want each of the forms to collect different data. You also want each of the forms to be distinct and have a different feel and look.

For example, you may want to display three forms as follows. 

One - to display as a slide-in box at the top of the Home page:

the shack form for home page

Note: See this document on detailed instructions on how to display a Shack Form in a slide in box.

Another one - to show as a slide-in box positioned in the top right corner of the page of a Joomla article A:

 shack form for article a

The third one could be a form module to display as a slide-in box at the bottom of the page of a Joomla article B:

the shack form for joomla article b

Achieving this is a four-step process:

  1. Create the required number of Shack Forms
  2. Create a hidden menu item for each Shack Form
  3. Assign each Shack Form to its menu item
  4. Test the final result.

Let's take a look at this process in more detail.


Step #1. Create the required number of Shack Forms

You start off in your Joomla administrator panel by going to "Extensions" > "Modules":

go to extensions modules

This will open up for you the "Modules (Site)" administrative screen. You want to find the "Shack Forms Pro" module listing and click on the checkbox next to its name to select it:

click on the checkbox

Next, you would want to click on the "Duplicate" button at the top of the screen:

click duplicate

Repeat this step one more time. You will now see three Shack Forms Pro modules displayed, as you can see on the image below:

  • "Shack Forms Pro"
  • "Shack Forms Pro (2)"
  • "Shack Forms Pro (3)":

the three shack forms pro modules

You want to rename all three modules to something descriptive as you see fit. For this document, I renamed my modules as follows:

  • "Shack Forms Pro - for the Home page"
  • "Shack Forms Pro - for the Joomla article A"
  • "Shack Forms Pro - for the Joomla article B":

 the three modules renamed

Now would be a good time to set the fields and feel and look individually for each module to meet your Joomla site requirements. 

Good job! At this point, you have three Shack Forms Pro modules for each of your required three pages. 


Step #2. Create a hidden menu item for each Shack Form

In this step, you will create a hidden menu item for each of your Shack Forms Pro modules, except for the module for the Home page.  This will ensure you will be able to assign each module to its required Joomla page.

You want to go to "Menus" > "Manage" > "Add New Menu":

go to menus manage add new menu

This will bring you to the "Menus: Add" screen. You want to create a hidden menu similar to the one displayed in the image below:

  • Title: Hidden Menu
  • Menu Type: hidden_menu
  • Description: My hidden menu items

create hidden menu

You want to click "Save & Close".

Now would be a good point to go to "Menus" > ["Your hidden menu"] > "Add New Menu Item":

menus your hidden menu add new menu item

For my demonstration, at this point, I will create a hidden menu item for a page with a Joomla article. I will embed the "Shack Forms Pro for the Joomla article" module inside the text of this article. 

You want to create the menu title. I created "Shack Form for the Joomla article A"

You want to click "Select" and select your required Joomla article. For my demonstration, I selected the "Shack Forms Pro - for the Joomla article A".

Now you want to click the "Link Type" tab and set the "Display in Menu" parameter to "No":

set the display in menu to no

At the top of the screen, you want to click "Save & New". You want to repeat the same step to create a menu item for another page with another of your Joomla articles.

Well done! At this point, you have three Shack Forms Pro modules. You created two hidden menu items for the pages with those two Joomla articles. 

You are ready to start putting everything together.  


Step #3. Assign each Shack Form to its menu item

In this step, you want to tell each of your modules on what Joomla page you would like it to display.

First, you want to go to "Extensions" > "Modules".

You want to open up the Shack Forms Pro module that you would like to display only on the Home page. In my demonstration, that will be the "Shack Forms Pro - for the Home page" module.

You should see the "Module" tab open.

You want to set the "Layout" parameter from the default "Static" to "Slide in box":

click slide in box

On the right side of the tab, you want to set the "Position" parameter to "debug" and the "Status" parameter to "Published":

set the position to debug and status to published

At this point, it would be a good time to click the "Menu Assignment" tab:

click the menu assignment tab

Now you want to click inside the "Menu assignment" field and in the dropdown list of options click "Only on the pages selected":

click only on the selected pages

You will see the "Menu Selection" box with your Joomla menus and their menu items:

At the top of this box, you want to click "None" to uncheck all the menu items. Then you want to check the checkbox for the "Home" menu item of the "Main Menu":

click none and then check the home checkbox

Next, you want to click "Save & Close".

Then you want to repeat this step for the "Shack Forms Pro - for the Joomla article A" module except checking this time the checkbox "Shack Forms Pro - for the Joomla article A".

You finish this step by repeating the same step for the "Shack Forms Pro - for the Joomla article B" module except checking this time the checkbox "Shack Forms Pro - for the Joomla article B".


Step #4. Test your multiple Shack Forms

Visit one by one the three pages to which you assigned a Shack Forms module. You should see that each page now displays its own module, just as you intended.


What's Next?

Save $1000's when you sign up to Joomlashack's Everything Club.

You will get access to all our 30 extensions, templates, and Joomla training.

Click here to join the Everything Club