Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QUESTION How about a specific components section for each page
#1
Just an idea but how about adding a specific components section for each page.

For example:

we still retain a common components page for stuff like side bar but for the home page and others, have a section that shows just the components for that page only.

It would make the user interface less cluttered if there were a lot of components used throughout the site.
Reply
#2
You could just name your components "home_sidebar", "contact_sidebar", "stuff_sidebar" ...
Then you can simply using if- or switch statement in your template to determine which page is actually loaded and then show corresponding component:

PHP Code:
$slug get_page_slug(false);

switch ($slug) {
    case 'home':
        get_component($slug.'_sidebar');
        break;
   case 'contact':
        get_component($slug.'_sidebar');
        break;
    case 'stuff':
    
get_component($slug.'_sidebar');
        break;


Or use a whitelist array of allowed pages:

PHP Code:
$slug get_page_slug(false);

$whitelist = array(
    
'home'
    
'contact',
    
'stuff'
);

if(
in_array($slug$whitelist)) {
    
get_component($slug.'_sidebar');

Reply
#3
(2016-07-20, 20:42:48)cobber Wrote: Just an idea but how about adding a specific components section for each page.

For example:

we still retain a common components page for stuff like side bar but for the home page and others, have a section that shows just the components for that page only.

It would make the user interface less cluttered if there were a lot of components used throughout the site.

I had that idea as well. Allthough components are used in your theme by default. I would say organise them per theme. But in general it would be nice to make custum groups of components.

You could do some organising with the plugin Components Extended .
Reply
#4
Somebody is working on a plugin for this
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
interesting..
Reply
#6
(2016-09-10, 07:11:39)datiswous Wrote: interesting..

I'm working on this, but for GS 3.4: Page Component plugin
Reply
#7
(2016-09-10, 15:04:17)DimaYakovlev Wrote:
(2016-09-10, 07:11:39)datiswous Wrote: interesting..

I'm working on this, but for GS 3.4: Page Component plugin


shrug. I wonder, why do we need another one? http://get-simple.info/extend/plugin/im-...elds/1057/
Here's a usage example https://bigin.github.io/ghpages/pagelayout/
Reply
#8
It is nothing like extra fields
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
Sure, probably it has a different name then and probably a veeeery user-friendly function call in front-end something like:
my_nice_function_to_get_a_component('and', 'a', 'gigantic', 'amount' 'of', 'the', 'parameters');

But jokes aside, what can it do differently?
Reply
#10
There is no configuration, you just click add page component on a page.
Page components do not need parameters, they are per page, why would you need parameters ?

It does exactly what it says, you install it, goto page click 1 button.

I don't really see why people always have problems with people creating small simple plugin that do one thing, sometimes you only want 1 thing. I have 20 plugins in my install that do 1 thing that I create as needed, this plugin replaces about 5 of them.

extra plugins is overkill for these situations, but suitable for maybe 2 of my other use cases instead for example.

I prefer single use plugins they can be more focused and light weight since they are loaded on every page load.

The plugin is less than 100 lines of code for example
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#11
(2016-09-11, 05:15:21)shawn_a Wrote: There is no configuration, you just click add page component on a page.

IM Extra Fields have not a single line of configuration code. You just need to create a single category and a single field for it that's all.

(2016-09-11, 05:15:21)shawn_a Wrote: It does exactly what it says, you install it, goto page click 1 button.

IM Extra Fields does the same, you go to the page select your category and save.

(2016-09-11, 05:15:21)shawn_a Wrote: I don't really see why people always have problems with people creating small simple plugin that do one thing, sometimes you only want 1 thing. I have 20 plugins in my install that do 1 thing that I create as needed, this plugin replaces about 5 of them.

I have no problems with people creating plugins, I only wonder why it is necessary to re-inventing the wheel. But I have real problems with people that say something of which they have no idea.

(2016-09-11, 05:15:21)shawn_a Wrote: extra plugins is overkill for these situations, but suitable for maybe 2 of my other use cases instead for example.

I prefer single use plugins they can be more focused and light weight since they are loaded on every page load.

The plugin is less than 100 lines of code for example

I disagree, nothing of it is true! The fact that they auto-loaded on every page whether or not it is necessary, make them NOT efficient, but do exactly the opposite. ItemManager loads its modules on the fly and only whenever it's necessary. That's why i can work with thousands of items like a champ while native components would quickly fail.
Reply
#12
create categories? I am already lost,
additional dependancies , I need 2 plugins now?

There are a ton of reasons why someone wants options, its not reinventing the wheel its matter of choice, choice is good.
Especially for something called "getsimple". Id say 90% of users do not want to even read a guide or docs.

Does itemmanager have anything to do with items manager plugin ?
items manager plugin has a bad rap, it was never developed beyond a few versions, i spent a hundred hours rewriting that plugin to use it.
Noone else created a plugin like it because it was being developed, and then boom , no more authpor, no more dev, no svn, so who got screwed ?
The users. Choices are good.

I have never used it for those reasons, maybe bad choice of name.

It also does not seem to match GS backend styles from screenshots ( again i never tried it )
I hear item manager I think item catalogs, not custom fields/data stores.

Does itemmanager work on php 5.2 ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#13
(2016-09-11, 07:29:30)shawn_a Wrote: create categories? I am already lost,
additional dependancies , I need 2 plugins now?

There are a ton of reasons why someone wants options, its not reinventing the wheel its matter of choice, choice is good.
Especially for something called "getsimple". Id say 90% of users do not want to even read a guide or docs.

In this case, it's definitively reinventing the wheel. But I agree, the choice is good.

(2016-09-11, 07:29:30)shawn_a Wrote: Does itemmanager have anything to do with items manager plugin ?
items manager plugin has a bad rap, it was never developed beyond a few versions, i spent a hundred hours rewriting that plugin to use it.

Not really, the current ItemManager has nothing in common with old items manager - except, perhaps, a bad rap lol

(2016-09-11, 07:29:30)shawn_a Wrote: Noone else created a plugin like it because it was being developed, and then boom , no more authpor, no more dev, no svn, so who got screwed ?

As said above, I haven't created the old item manager plugin and it has nothing to do with ItemManager.

(2016-09-11, 07:29:30)shawn_a Wrote: I have never used it for those reasons, maybe bad choice of name.

this is really a bad reason

(2016-09-11, 07:29:30)shawn_a Wrote: It also does not seem to match GS backend styles from screenshots ( again i never tried it )
I hear item manager I think item catalogs, not custom fields/data stores.

These are my personal changes and it has nothing to do with ItemManager, again, really a bad reason to not try a plugin.

(2016-09-11, 07:29:30)shawn_a Wrote: Does itemmanager work on php 5.2 ?

No, which is a good thing,we have 2016 now and PHP 5.2 belongs to the scrap, its ugly and slow.

But this all does not alter the fact: The plugin doing things exactly like IM Extra Fields, has the same function and completely superfluous
Reply
#14
I installed this plugin, it does not do what I want it to do.

I fail to see where i can add unique php code components to individual pages.

I tried a category with a chunk field, but no field shows up on the page, i assume chunk can only be modified by field values defaults?

Not sure how this does what we have been discussing, do you have a newer version with code blocks per page?

Page components adds an actual component with codemirror, that can be used for that page, and does not clutter your components editor. And provides a getter function for templates.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#15
Yes the Chunk fields is just a simple piece Markup or JS code. And you don't really need a Chunk Field to use the plugin.

As I said earlier, http://get-simple.info/forums/showthread...3#pid56783 I am not a friend of exec() and I try to avoid using it as far as possible, IM Extra Fields components uses a template engine to inject their dynamic content. I had never missed this function it in the practice and it would have been so easy to include simple eval code in the code, in the same way as GS:

Code:
eval("?>" . strip_decode($comp) . "<?php ");

But you are right with your hint, that it's maybe just one point where the function differs from IM Extra Fields and of course, the plugin can also be used in case to execute PHP code blocks.
Reply
#16
The poster asked specifically for a feature to add "specific components section for each page"
A component is a block of code allowing html,js,and php as per GS semantics.

3.4 introduces snippets which are more suitable for non code widgets or templates, php is not available in snippets. And i fully expect people will make some great shortcode and templating solutions for them. This also allows site admins to disable php code if they want by removing components. Markdown and other features will be easy to add as well.

Adding per page snippets will probably be useful as well again as to not clutter the snippets/components editors, and at some point in the future 3.5 ? those editors will be less cumbersome and not have to include everything as one file etc.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#17
Well, but, I not really need these stuff, everything what I need is already there. But perhaps some people have the pleasure of this stuff that they've already got for years right under their nose, even if they don't fully realize it yet ;-)
Reply
#18
From what i can tell this plugin is still fairly new, i see lots of room for improvements, there already have been several attempts at similar concepts, i think there is the matrix plugin and some stuff built around it and custom fields, and special pages, which are very popular. I think what will do the best is one that is easiest to use for basic users, which can easily be accomplished by adding some step based UI flow or similar UI changes.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#19
Yeah... that is exactly what I have tried to accomplish with these examples wrapper plugins like IM Extra Fields, ItemMangers-Photogallery, Frontainer, Simple Forum etc. All of these plugins are build around ItemManager framework have a very robust design but are not very polish with intention. The goal of ItemManger is to make it attractive for developers by powerful API and the wrapper plugins more easier to use for the end-user...
But let's see, perhaps someone else will see all the advantages by using ItemManager and have the urge to further development.
Reply




Users browsing this thread: 2 Guest(s)
Free HDTV Channels Residential Solar Panels