Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Change name of panel dynamically

Asked Modified Viewed 3,154 times
I
isuzucrewcab
I
  • Member, joined since
  • Contributed 70 posts on the community forums.
  • Started 32 threads in the forums
  • Started this discussions
asked
Member

When a panel is created, the name is coded into the openside parameter in panel management.

Is there any way to dynamically change the panel name depending on variables in the script?

Example.

I have one script that is used for 2 slightly different functions. What I want is that if one option is chosen, I want the panel name to say "Read all Posts". If the option is chosen, it would read "Read your Posts".



Thanks


Steve
0 replies

6 posts

B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

What about this:



if($action == "whatever") {
openside("Name 1");
} else {
openside("Name 2");
}

0 replies
I
isuzucrewcab
I
  • Member, joined since
  • Contributed 70 posts on the community forums.
  • Started 32 threads in the forums
  • Started this discussions
answered
Member

Quote

slaughter wrote:
What about this:



if($action == "whatever") {
openside("Name 1");
} else {
openside("Name 2");
}



Ok, seems logical, but how do I pass variables to a panel?
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

In PHPFusion first the content of the Panels is loaded and after that the content of the page.

So if you define a variable in Custom Pages for example, the variable is not available in Panels I think.

Is this your question? I'm not sure if I unterstand your problem.

But if yes, then take a look at the file includes/output_handling_include.php

There is a function called replace_in_output();

You can call the name of the panel for example REPLACEMEPLZ.

And then you can change the title with this code:


replace_in_output("REPLACEMEPLZ", "Title 1");


I did not test it, but it should work :)
Edited by Basti on 11-04-2010 16:39,
0 replies
I
isuzucrewcab
I
  • Member, joined since
  • Contributed 70 posts on the community forums.
  • Started 32 threads in the forums
  • Started this discussions
answered
Member

Quote

slaughter wrote:
...
But if yes, then take a look at the file includes/output_handling_include.php

There is a function called replace_in_output();

You can call the name of the panel for example REPLACEMEPLZ.

And then you can change the title with this code:


replace_in_output("REPLACEMEPLZ", "Title 1");


I did not test it, but it should work :)



Great..that worked. For those using this please note that any text matching parameter 1 is replaced by parameter 2, so use a unique name in the panel name.

Thanks again.
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

no problem, I'm glad that I could help and that it works :)
0 replies
— 1 year later —
G
G
  • Newbie, joined since
answered
Newbie

buy.Amplified clothing is the biggest music inspired street wear brand in the Uk. Hogan Shoes it is popular for their rolling stone tongue tee's and amplified clothing. This amplified clothing is also popular in celebrities like David beckham, Hogan Scarpe kate moss, The Kooks, the Sugababes, Angelina Jolie and her baby also used amplified clothing ‘s tees and amplified clothing. Amplified clothing is well-known in all persons of different age. amplified clothing has various styles, and designs. Its verity includes amplified clothings, Franklin Marshall Sale belts, and other fashionable garments. This is only the brand that bring splash in the fashion world amplified clothing inspired by the music. You can find different unusual pictures on the front side of amplified clothing. Franklin Marshall Store You can buy any verity of amplified clothing.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 6 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

I
I
  • Member, joined since
  • Contributed 70 posts on the community forums.
  • Started 32 threads in the forums
  • Started this discussions
B
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet