Extension contrib folder placement

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Sniper_E
Registered User
Posts: 728
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Extension contrib folder placement

Post by Sniper_E » Tue Apr 17, 2018 5:54 pm

Hey guys, I'm creating a sidebar menu extension with events in the templates to add nav links.

I have put together a bunch of event templates for several extensions to add their links in the sidebar.
Is it allowed to have a contrib folder in my ext to place these event templates in and if so, where would it have to go?
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
:!: Sniper_E Styles | phpbbmodders :!:

User avatar
GanstaZ
Registered User
Posts: 523
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: Extension contrib folder placement

Post by GanstaZ » Tue Apr 17, 2018 6:18 pm

Template events should be in all/template/event or specific style/template/event folder, php events work in any ext root folder. Why not add those links in php file, and with dispatcher add or modify?
"When answer lies in the question,.. question becomes redundant!"

User avatar
Sniper_E
Registered User
Posts: 728
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: Extension contrib folder placement

Post by Sniper_E » Tue Apr 17, 2018 6:50 pm

I must not be able to explain myself correctly. You just stated the obvious.

My templates in my sidebar ext have events in them just like any template in the prosilver/template/ folder.
We all setup event templates in our extensions to insert the codes into any given style template.

Let me give you an example. My user_links.html template.

Code: Select all

        <ul class="topiclist sidebar">
			{% EVENT sidebar_user_before %}
Common links are coded here.

After all the links...
			{% EVENT sidebar_user_after %}
		</ul>
So I want to add Account links at the top of that menu so I created an event template in Account links ext.

ext/flerex/linkedaccounts/styles/prosilver/templates/event/sidebar_user_before.html

Code: Select all

{% if switchable_account %}
{% INCLUDECSS '@flerex_linkedaccounts/linkedaccounts.css' %}
<li class="row bg2 sidebar-link">
	<a href="{{ U_PROFILE }}?i=-flerex-linkedaccounts-ucp-main_module&mode=management">
	<i class="icon fa-user-secret fa-fw" aria-hidden="true"></i>{{ lang('LINKED_ACCOUNTS') }}</a>
	<ul class="forabg side-navlinks">
		{% for account in switchable_account %}
		<li class="row <!-- IF account.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF --> side-link">
			<a href="{{ account.SWITCH_LINK }}" class="side-avatar">
			{% if account.AVATAR %}
				{{ account.AVATAR }}
			{% else %}
				<img src="{T_THEME_PATH}/images/no_avatar.gif" class="avatar" alt="">
			{% endif %}
			{{ account.NAME }}</a>
		</li>
		{% endfor %}
	</ul>
</li>
{% endif %}
{% if U_CAN_LINK_ACCOUNT %}
<li class="row bg2 sidebar-link">
	<a href="{{ U_PROFILE }}?i=-flerex-linkedaccounts-ucp-main_module&mode=link">
	<i class="icon fa-user-secret fa-fw" aria-hidden="true"></i>{{ lang('LINKING_ACCOUNT') }}</a>
</li>
{% endif %}
You see, any other ext that you want a link in the sidebar menu will have their own event template added to it.
I've made other event templates for other exts to have their links in the sidebar. Each one will go in their ext event/ folder.

I am simply asking if it is allowed to put a contrib folder in my sidebar ext to hold all of these event template and where can it be.

Again... these event templates I created do not go in my sidebar event/ folder. They go in each of the other ext's event/ folder.
I would just like to provide the event templates for the other exts so an admin would not have to create them.
I can just post them somewhere if a contrib folder is not allowed.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
:!: Sniper_E Styles | phpbbmodders :!:

User avatar
GanstaZ
Registered User
Posts: 523
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: Extension contrib folder placement

Post by GanstaZ » Tue Apr 17, 2018 7:13 pm

Haven't seen any rules, that would state that it is not allowed).. You as a creator, can create any folder where ever you want in your extension.
"When answer lies in the question,.. question becomes redundant!"

User avatar
3Di
Registered User
Posts: 12943
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extension contrib folder placement

Post by 3Di » Tue Apr 17, 2018 7:19 pm

Just create your contrib folder and put those files therein, add maybe a read.me for the sake of the usage.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
david63
Jr. Extension Validator
Posts: 14723
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Extension contrib folder placement

Post by david63 » Tue Apr 17, 2018 8:01 pm

Can I just point out that events in extensions should be preceded by the author name and a full stop i.e. myauthor.my.template.event in order to prevent having duplicates in other extensions.

Also the danger with creating templates for other extensions is that if the author of the other extension makes changes then your templates may not work. I would suggest that the code changes to incorporate your extension in other extensions should go in the FAQ section of the contribution and not packaged with your extension. Alternately contact the relevant extension authors and collaborate.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
3Di
Registered User
Posts: 12943
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extension contrib folder placement

Post by 3Di » Tue Apr 17, 2018 9:53 pm

Are we talking about template events customised on a per extension basis or PHP events?
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
Sniper_E
Registered User
Posts: 728
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: Extension contrib folder placement

Post by Sniper_E » Tue Apr 17, 2018 10:09 pm

I am talking about other extensions having an event template in each of their ext's event/ folder to insert links into my sidebar ext.

Like mChat's even/ folder having an event template that will add a link to the custom page the same as it does for the header_navbar.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
:!: Sniper_E Styles | phpbbmodders :!:

User avatar
3Di
Registered User
Posts: 12943
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extension contrib folder placement

Post by 3Di » Tue Apr 17, 2018 10:29 pm

So make a contrib folder and maybe subfolders.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
Sniper_E
Registered User
Posts: 728
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: Extension contrib folder placement

Post by Sniper_E » Tue Apr 17, 2018 11:30 pm

I will, thanks. I'll start a post here soon in ext development with what I have in there.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
:!: Sniper_E Styles | phpbbmodders :!:

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests