close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

I want to show different plugin documents when user click on different buttons.

Thread began 3/17/2020 1:46 pm by Jonas | Last modified 3/19/2020 1:07 pm by Ray Borduin | 61 views | 11 replies |

Jonas

I want to show different plugin documents when user click on different buttons.

I want to show different plugin documents when user click on different buttons. Can I use the "Insert Dynamic Plugin" for this? If so, what is the Trigger Variable for this, and how do I coding the buttons?

Sign in to reply to this post

Ray BorduinWebAssist

Yes, you could use the buttons to set a session variable and then show different plugins based on the session variable value.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jonas

I try to understand how this works.
1. I create a form for the buttons because I have no form before. Method = "POST".
2. I create two buttons - Type = "submit".
3. From the server-behavior tab, I select WebAssist-> Cookies-> Set Session Value.
4. As Trigger, I select "Button: 1 Pressed".
5. As a Session name, I write "view mode".
6. As Value, I write: "List".
Then I repeat steps 3-6 for the next button.
7. The section tag is highlighted. I choose WebAssist-> FrameworkBuilder-> Plugins-> Inser Dynamic Plugins.
8. As trigger Variable, I select "1" from the form [$ _POST ["1"].
Are these steps correct? Because I don't make it work. Is there any guide on what steps to take?

Sign in to reply to this post

Ray BorduinWebAssist

Your value for the dynamic plugin would be : $_SESSION["view mode"]

Sign in to reply to this post
Did this help? Tips are appreciated...

Jonas

I wonder if this is the best solution.

What I am looking for is that the user can choose between two different view modes / layouts. This can be seen on many websites. Either the content is displayed as a list or it is displayed as blocks, such as the Public layout in the DataAssist Result Page.

Is there any server behavior for this, similar to Sort, or how to do this in the simplest way?

Sign in to reply to this post

Ray BorduinWebAssist

The simplest way is to save a session variable with the selection and use it to conditionally show one or the other. If you need help then I could show you how in a premier support ticket with screen sharing.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jonas

I have made another attempt. However, I receive the following error message in the browser:
Fatal error: Cannot use isset () on the result of an expression (you can use "null! == expression" instead) in /www/webvol16/z3/e7v7i55mki9ry4i/jonasn.se/public_html/aboutbeer/provningar/aktuella-provningar .php on line 43.

Here is the code that WA writes:
if(true){
// WebAssist Framework Builder Dynamic Plug-in: $WA_aktuella_provningar_lista_1584553123999
switch(isset(visningsform)?visningsform:""){
case "[Lista]":
$WA_aktuella_provningar_lista_1584553123999 = new WA_Include("../plugins/aktuella-provningar-lista.php");
break;
case "[Block]":
$WA_aktuella_provningar_lista_1584553123999 = new WA_Include("../plugins/aktuella-provningar-columns.php");
break;
default:
break;
}
if(isset($WA_aktuella_provningar_lista_1584553123999)){
require($WA_aktuella_provningar_lista_1584553123999->BaseName);
$WA_aktuella_provningar_lista_1584553123999->Initialize(true);
}
// End: WebAssist Framework Builder Dynamic Plug-in: $WA_aktuella_provningar_lista_1584553123999
}
?>
Line 43 is: switch(isset(visningsform)?visningsform:""){

Sign in to reply to this post

Ray BorduinWebAssist

switch(isset(visningsform)?visningsform:""){
Should be:
switch(isset($_SESSION["visningsform"])?$_SESSION["visningsform"]:""){

Sign in to reply to this post
Did this help? Tips are appreciated...

Jonas

Thanks, No more error message.
But why is it that the plugin does not appear? Nothing happens when I press the buttons.

Sign in to reply to this post

Ray BorduinWebAssist

You are setting to:
"Block" or "Lista"

but your condition is looking for values:
"[Block]" or "[Lista]"

They need to match.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...