Announcement

  •  » Themes
  •  » Possible for a theme to detect if a plugin is installed?

#1 2015-05-28 00:17:37

philb
Member
2014-07-22
30

Possible for a theme to detect if a plugin is installed?

I'm thinking it might be nice to write an extension to enable fine grained configuration of my theme.

So, my thoughts would be that anyone who installed my theme would see a message (to the admin only ideally) suggesting they should install the extension too.

Is this possible, or is there a better way to do this perhaps? Can a theme itself have admin specific pages?

Offline

 

#2 2015-05-28 00:39:57

philb
Member
2014-07-22
30

Re: Possible for a theme to detect if a plugin is installed?

Ok, answered my own question, noticed some other themes have admin pages so no need for a plugin!

Offline

 

#3 2015-05-28 09:22:28

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13821

Re: Possible for a theme to detect if a plugin is installed?

Hi philb,

Tell us more. Which plugin are you thinking about?

Offline

 

#4 2015-05-28 09:24:40

philb
Member
2014-07-22
30

Re: Possible for a theme to detect if a plugin is installed?

I wanted to add theme configuration in the admin, but I found out that you don't need to have a separate plugin, just to add admin/admin.inc.php to the theme :)

Offline

 

#5 2015-05-28 09:26:48

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13821

Re: Possible for a theme to detect if a plugin is installed?

OK. What kind of configuration settings do you plan to have in your theme?

Offline

 

#6 2015-05-28 09:30:00

philb
Member
2014-07-22
30

Re: Possible for a theme to detect if a plugin is installed?

At this stage, hard to say, but some of the things I am thinking of including are...

* Ability to switch between Disqus comments and Piwigo comments
* Turn on/off theme features
* Adding cover images on index page

Really, it all depends on how much free time I have.

Offline

 

#7 2015-05-28 14:30:14

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13821

Re: Possible for a theme to detect if a plugin is installed?

philb wrote:

* Ability to switch between Disqus comments and Piwigo comments

It sounds more like a separate plugin to me. Being able to have Disqus comments on any theme (including yours) would be better.

philb wrote:

* Adding cover images on index page

Can you tell us more? What do you mean by "cover images"?

Offline

 

#8 2015-05-28 14:38:46

philb
Member
2014-07-22
30

Re: Possible for a theme to detect if a plugin is installed?

plg wrote:

philb wrote:

* Ability to switch between Disqus comments and Piwigo comments

It sounds more like a separate plugin to me. Being able to have Disqus comments on any theme (including yours) would be better.

I've looked into this a little and I'm not sure how it can be achieved without quite a hacky solution that would manipulate the comments HTML and replace it with Disqus as there are no plugin hooks specifically for comments. At least, not in the default theme, did I miss something?

plg wrote:

philb wrote:

* Adding cover images on index page

Can you tell us more? What do you mean by "cover images"?

A landing page, perhaps there are plugins to achieve this though.

Last edited by philb (2015-05-28 14:39:29)

Offline

 

Notice: Undefined offset: 5 in /var/www/piwigo.org/forum/include/parser.php on line 551

#9 2015-05-28 14:56:53

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13821

Re: Possible for a theme to detect if a plugin is installed?

philb wrote:

I've looked into this a little and I'm not sure how it can be achieved without quite a hacky solution that would manipulate the comments HTML and replace it with Disqus as there are no plugin hooks specifically for comments. At least, not in the default theme, did I miss something?

To achieve this in Piwigo, use the prefilter system : it lets you add some template bloc anywhere you want. You can find an example on https://github.com/plegall/Piwigo-custo … in.inc.php

philb wrote:

plg wrote:

philb wrote:

* Adding cover images on index page

Can you tell us more? What do you mean by "cover images"?

A landing page, perhaps there are plugins to achieve this though.

Maybe just using [extension by P@t] Additional Pages, see a guide on [Github] Piwigo-custom_download_link file main.inc.php">https://github.com/plegall/Piwigo-custo … in.inc.php

philb wrote:

plg wrote:

philb wrote:

* Adding cover images on index page

Can you tell us more? What do you mean by "cover images"?

A landing page, perhaps there are plugins to achieve this though.

Maybe just using [extension by P@t] Additional Pages, see a guide on

Offline

 
  •  » Themes
  •  » Possible for a theme to detect if a plugin is installed?

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact