Announcement

  •  » Extensions
  •  » UserCollections - something I don't understand

#1 2013-11-21 15:17:42

marjolein
Member
Amsterdam, NL
2013-11-10
29

UserCollections - something I don't understand

Still working on my theme - and learning how Piwigo works... and currently looking at 'external' paths for including things from templates.

Looking at the collection_edit.tpl and collection_view.tpl templates I see they include a line of code as follows:

Code:

{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}

No problem understanding what that is intended for - but I double checked and do not find a navigation_bar.tpl template in the template directory of UserCollections.

How would this work? Would the template (implementation) somehow check the current theme's template directory if it isn't found in the the current plugin's directory? Or is the file l missing? Or is a path missing so that (for instance) it can be pulled from the default theme's template directory?

I also note that these same templates do use an (absolute) path to include a template from the plugin's themes directory, like:

Code:

{include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/stripped.tpl'}

I would appreciate if someone could clarify for me if including the navigation_bar.tpl would work as coded (and how it would work) or if the file or a path to a file is just missing?

Offline

 

#2 2013-11-21 15:45:45

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3270

Re: UserCollections - something I don't understand

Hello,

This is handled by Smarty the template system : it will look for the .tpl file in any know template folder, so your current theme and "default" (in this order)

for the other file, I use absolute path because the .tpl file is located in the plugin folder and not in the template folder

Offline

 

#3 2013-11-21 19:06:53

marjolein
Member
Amsterdam, NL
2013-11-10
29

Re: UserCollections - something I don't understand

Thanks for the reply, mistic100!

mistic100 wrote:

This is handled by Smarty the template system : it will look for the .tpl file in any know template folder, so your current theme and "default" (in this order)

Aha! that's the bit I was missing. Now I understand - and know how to code my own templates or "plugin extensions". :)

mistic100 wrote:

for the other file, I use absolute path because the .tpl file is located in the plugin folder and not in the template folder

That's clear now, thanks.

Another question if I may... UserCollections templates include one of several "theme-specific" template files, and two of these include 1-3 general toolbar buttons (sortorder, derivatives, caddie) plus three collections-specific buttons (mail, clear, delete) - and that's what I see in the UI. But these are followed by:

Code:

  {if !empty($COLLECTION_ACTIONS)}
    {$COLLECTION_ACTIONS}
  {/if}

...which a quick grep tells me will never 'fire' because the $COLLECTION_ACTIONS variable is not filled anywhere.

Is this a remnant of an earlier way to produce the three collections buttons, or is it a hook for possible future extension?

(Hacking away on my theme every day and still having fun - Piwigo is a pleasure to work with!)

Offline

 

#4 2013-11-21 19:18:12

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3270

Re: UserCollections - something I don't understand

it's a hook :)
juste like $PLUGIN_INDEX_ACTIONS and $PLUGIN_PICTURE_ACTIONS

note that in the next version, specific theme template files will be removed, thanks to this http://piwigo.org/doc/doku.php?id=dev:c … stom_pages and this http://piwigo.org/doc/doku.php?id=dev:c … on_buttons

Offline

 

#5 2013-11-21 21:29:21

marjolein
Member
Amsterdam, NL
2013-11-10
29

Re: UserCollections - something I don't understand

mistic100 wrote:

it's a hook :)
juste like $PLUGIN_INDEX_ACTIONS and $PLUGIN_PICTURE_ACTIONS

OK :) (more to explore :))

mistic100 wrote:

note that in the next version, specific theme template files will be removed, thanks to this http://piwigo.org/doc/doku.php?id=dev:c … stom_pages and this http://piwigo.org/doc/doku.php?id=dev:c … on_buttons

Generic template for custom pages ... Add action buttons

He, great minds think alike... that's just about what I'm working on right now (though I devised my own way to doing exactly this). Basically, I am building a (one) theme-specific template which in turn includes plugin-specific toolbuttons and plugin-specific content.

Looks like the new method is more sophisticated than mine (but then again for my new theme I'm doing my best to keep my work limited to templates (and plugin's template files) only, not the processing behind it.

Anyway, that's very useful information, and it looks like the transition would be easy for me given what I'm already doing. :) Thanks!

Offline

 

#6 2013-11-21 21:34:14

marjolein
Member
Amsterdam, NL
2013-11-10
29

Re: UserCollections - something I don't understand

marjolein wrote:

that's just about what I'm working on right now (though I devised my own way to doing exactly this). Basically, I am building a (one) theme-specific template which in turn includes plugin-specific toolbuttons and plugin-specific content.

From the top of my 'wrapper_default_mk.tpl' in its current state:

Code:

<!--wrapper_default_mk.tpl (UserCollections/template/themes)-->
{**
 * This is a theme-specific 'wrapper' template that:
 * - contains theme-specific code (e.g., the 'top' portion of the page)
 * - *INCLUDES* plugin-specific content for the page main content
 *   (which in turn may again include theme-specific sub-templates!),
 *   and (later) also some plugin-specific tool buttons 
 * - has general bits of content that appear 'everywhere', not theme
 *   or plugin-specific (apart from its theme-specific position)
....

And from your previous reply I had already deduced I could move this to my own theme's template directory instead of the plugin's :)

(plugging away...)

Offline

 

#7 2013-11-25 12:45:05

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3270

Re: UserCollections - something I don't understand

I don't understand your question, and it does not seem to be related to UserCollections

Offline

 

#8 2013-11-26 13:44:38

flop25
Piwigo Team
2006-07-06
6861

Re: UserCollections - something I don't understand

AidenGrayson wrote:

See my question is when we select the country from drop down then how we can check it that user is from that country or some spammer is setting it up.

To restrict the registration in order to avoid spammer or bot registred, try plugins using Captcha by searching on http://piwigo.org/ext/index.php

If you're refering to something else, please post in an other thread and be even more explicit


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#9 2013-11-26 16:26:34

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3270

Re: UserCollections - something I don't understand

AidenGrayson wrote:

See my question is when we select the country from drop down then how we can check it that user is from that country or some spammer is setting it up.

so this is absolutely not related to UserCollections

open another topic

Offline

 
  •  » Extensions
  •  » UserCollections - something I don't understand

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2018 · Contact