• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED include page and send variable between pages

Messages
5
Likes
0
Points
1
#1
I need to create a page main from includes par and write. And read and change and write variable ( $menu_h02)
include('par'); ???????? - does not work and variable is null.
Please Help me.

------------------------------------------------
page: par

[insert_php]

// clear variable
$menu_h02 = "";

[/insert_php]

-------------------------------------------------
------------------------------------------------
page: write
[insert_php]

// display variable
echo '$menu_h02: ' .'$menu_h02 ;

[/insert_php]

-------------------------------------------------
-------------------------------------------------

page: main


[include-page id="par"] - I'm using another plugin - Improved Include Page in php code plugin not works


[insert_php]

?????? include('par'); ???????? - does not work

// change variable
$menu_h01 = "VISIBLE";

?????? include('write'); ???????? - display here: $menu_h02: VISIBLE

[/insert_php]

-------------------------------------------------
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello
include('par') is a PHP function.
Read the documentation for the Improved Include Page plugin
PHP:
<?php iinclude_page('par'); ?>
If you have any questions about our Woody plugin, we will answer them.

P.S. From the next version of Woody, the [insert_php] syntax will stop working. Please use the new one: [wbcr_php_snippet id="ID"]
 
Messages
5
Likes
0
Points
1
#3
Hello , thank you for the info.
When using [wbcr_php_snippet id="ID"] can I work with variables between snippets?

P.S. stop working [insert_php] is a very rough solution. When a page is composed of multiple parts (snippets), it will be confusing.
 
Messages
5
Likes
0
Points
1
#4
addition:

How in HTML code display php variable without [insert_php]?
example:

<table>
<tr>
<td>Name = [insert_php] echo $name; [/insert_php]</td>
</tr>
</table>
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#5
addition:

How in HTML code display php variable without [insert_php]?
example:

<table>
<tr>
<td>Name = [insert_php] echo $name; [/insert_php]</td>
</tr>
</table>
In snippet [wbcr_php_snippet id="ID"]:
PHP:
echo $name;
In post:
HTML:
<table>
<tr>
    <td>Name = [wbcr_php_snippet id="ID"]</td>
</tr>
</table>