Topic Closed
Tobias
40 Posts

Hi Script-Gurus!

I want to selectively disable one Gadget (Share_Easy) for the imprint / legal contatc page of my website. Basically the share easy should be used to share a page, if people find it intresting, but i want to avoid ending up with full adress and comment "Tobias is a real kneebiter!" in some social networking site, though it is probably correct .

So basically i need the variable names to do a:

if (page != Imprint)    PrintGadget

Any ideas?

Bests, Tobias

 

11 years ago#1599

Stano
483 Posts
16.6K Downloads
1 Themes
1 Plugins

Hello Tobias, maybe this procedure should work.

Go the menu Appearance - Layouts - Add new layout, then choose one theme and click "Use this theme in new layout". Now you have two layouts - one Default and one New created. Now you can edit the Default layout and remove the Share gadget from it, and retain it only for the new layout. Now you can go to menu Content - Page Manager, choose your page and assign for it the new layout.

11 years ago#1606

Tobias
40 Posts

Thanks Stano!

Yes, this will probably work... I will give it a try. Still i think it can be done with one line in the gadgets php code :)

Bests, Tobias

11 years ago#1621

Stano
483 Posts
16.6K Downloads
1 Themes
1 Plugins

You are right, you can modify gadget's source code, insert these 3 lines in Gadget_Share_Easy.php and it should work:

function Gadget_Share_Easy()

{

    global $title;

    if ($title!='Imprint')

    { return; }

    $this->setSharingSnippet();

    echo $this->getSharingSnippet();

}

 

Edited: 11 years ago#1624

Tobias
40 Posts

Great! Thanks!

The variable name "$title" was what i was looking for.

Bests, Tobias

 

11 years ago#1630

Tobias
40 Posts

Works like a charm... In the end i went for this:

  function Gadget_Share_Easy()
  {
    global $title;

    echo '<h3>Share</h3>';

    if ( $title != 'Impressum' && $title != 'Disclaimer' )
    {
      $this->setSharingSnippet();
      echo $this->getSharingSnippet();
    }
  }

Thanks again!

 

 

11 years ago#1632

Stano
483 Posts
16.6K Downloads
1 Themes
1 Plugins

That 's good Tobias. I am also glad, that i could help :-)

Edited: 11 years ago#1636

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Ennetb├╝rgen (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Websi...

Find out more about our Provider Spotlight

Log In

  Register