Recent Topics

Request additional param for Event: AfterCollectionUpdate()

Started by on Oct 28, 2016 – Contents updated: Nov 27, 2016

Oct 28, 2016 10:22    

1) When changing a skin, the event AfterCollectionUpdate() fires.

2) But there is no way of telling what the collection previous skin was because there is no event for BeforeCollectionUpdate()

3) Could a solution be made available to tell when a skin for a collection was changed, what the previous skin I'd was (not the new one)?

4) You may ask why this is needed? b2evolution made disp handler available for plugins. This empower plugins to define a custom disp=custom.

This page can then display content by means of four ways:

a) referring to items,
b) what the plugin defined,
c) static content,
d) containers & widgets.

5) my plugin adds custom containers to the skin in use for the Collection. However, if the user changes the Collection skin, the plugin adds the custom containers to the new skin through the AfterCollectionUpdate() event, but it cannot remove the custom containers from the previous skin because there is no way (I can seem to find) to tell what the previous skin_ID was. This does not support my plugin's 'clean footprint' policy.

6) At this stage, the only way to circumvent this issue, is for the plugin, to check every skin NOT IN USE during AfterCollectionUpdate() and remove the files the plugin may have installed. This seems redundant and tedious.

7) In terms of adding containers to the skin (possibly through a skin) this issue was discussed long ago:

http://forums.b2evolution.net/add-skin_container-from-plugin.
Thread started by achillis, Mon Apr 6, 2015 15:54 – Last touched: Sun Jun 21, 2015 03:04
@achillis wrote earlier:

Is there a way to add a skin container from a plugin?

The things is, containers allows the user to add widgets and customize the disp page created by a plugin.

Oct 30, 2016 02:50

First, if we add BeforeCollectionUpdate(), does it solve your problem?

Then, I'm not sure I fully understand what you are doing: are you adding a container into the skin's PHP templates?

Finally, if you are missing a container in some of the default skins/templates, please show us where (screenshot) so we can add it cleanly rather than having your plugin mess around with PHP files.

Oct 30, 2016 09:32

@fplanque wrote earlier:

First, if we add BeforeCollectionUpdate(), does it solve your problem?

Yes, it would

Oct 30, 2016 10:35

@fplanque wrote earlier:

Finally, if you are missing a container in some of the default skins/templates, please show us where (screenshot) so we can add it cleanly rather than having your plugin mess around with PHP files.

That does not make sense at all. What would make sense and will solve the problem is if plugins could have the ability to create/add containers. If this is not possible, please help me understand why not.

Oct 30, 2016 14:38

You didn't not answer my second questioN. Is your plugin modifying the PHP files of the skins to add containers into them?

Oct 30, 2016 14:42

Not modifying. On your previous advice the plugin copies/installs a separate file into the skins folder with the new container. The container is then discovered. Essentially, the original files remains untouched.

Oct 30, 2016 15:40

OK, so:

1) which template does the plugin override with a new template?

2) will you please post a screenshot showing the difference between the standard template and the one from your plugin; i-e where the new container is added.

3) Optionally, I'd be interested in seeing what you put into that new container.

Thanks.

This post has 4 feedbacks awaiting moderation...


Form is loading...

multiblog platform – This forum is powered by b2evolution CMS, a complete engine for your website.