News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

New personal feature/mod - fragments

Started by mageguild, May 22, 2012, 07:35:56 AM

Previous topic - Next topic

mageguild

I am looking for a particular mod for my site.  The purpose of this mod (which I would call fragments) is to save information, code or anything really which can be called within the templates.  There is no limit of what a fragment can hold (eg, PHP code, HTML or just text). 

the purpose of this mod is to allow me to select which areas of my site that I can dynamically control via the admin (eg. Sidebar positions for widgets being built on the fly, header positions for promotion text, ad code, my custom SEO meta values etc). 

Example of usage:

I would create a fragment with a name "sidebar_position_1".  This fragment will contain the details of what I would like to display in that position.  In my sidebar template, I would have a piece of code that looks for that fragment and renders it as is (example code would be something like:  if (!empty($fragment['sidebar_position_1'])) { $fragment['sidebar_position_1'] }

The mod would allow me to create as many fragments as I wish in the admin.  These fragments wouldn't be used unless I have added code in the templates for each position that I would like to control using a fragment.

I have not found a solution that can help solve my problem but maybe someone can suggest something or if anyone does any mod building (at a fee) I would be very interested. 

Contact me if anyone is interested. 

Thanks

Arantor

Sounds like you need one of the portal mods, which works pretty much in this fashion.
Holder of controversial views, all of which my own.


CapadY

Another option is the Custom_Permissions MOD. Herewith you can decide what parts to show for each membergroup.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

Arantor

Quote from: CapadY on May 23, 2012, 08:54:37 AM
Another option is the Custom_Permissions MOD. Herewith you can decide what parts to show for each membergroup.

No, it just lets you add permissions. You still have to actually write code using said permission. Portals cover both the permission and display parts.
Holder of controversial views, all of which my own.


MrPhil

You might be able to steal some code from mod 319 (Custom Profile Fields), for the creation and maintenance of the table data, and the reading in to an array for the post. You would probably drop most of the existing code for outputting the custom fields. Then you add code to your template to output these array elements if defined (isset && !emtpy) in the desired place. The original CPF mod could give you some guidance on how to do this. You could even elect to display (or not) based on permissions or group membership.

Advertisement: