Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Input Tabs
#1
SIMPLE INPUT TABS 2!

http://get-simple.info/extend/plugin/sim...-tabs/523/


The template:

Change the existing code:

Code:
<?php get_page_content(); ?>

To a new function:

Code:
<?php insert_page_content(); ?>

Wherever else you will be adding content to the page, add the same code with a Tab name in the brackets (in quotes):

Code:
<?php insert_page_content("sidebar"); ?>

AND THAT'S IT!

To use the plugin.

Navigate to the page edit screen and click the corresponding named Tab.

Simple.
Reply
#2
It doesn't seem to work for me.

If I put the input <?php insert_page_content(); ?> in a section of the template the content of that page is shown on these different places. But if I want to have content of other pages and I use tags like this:

<?php insert_page_content("sidebar"); ?> (where I used another page for input of that tag, like in your description)...

The same content is shown on these places as using the <?php insert_page_content(); ?>

See attachment.



Also, in such a configuration it should be clear from the page manager what sections are part of one page..
Reply
#3
Hmm looks like I might have messed with something when I changed things around to let plugins change the data.
On line 71 or so can you see this line:

Code:
echo exec_filter('content',$data);}

Replace it with:

Code:
echo $data;}

That should undo my change I think. Sorry about that. Confused
Also I have re-uploaded the file, so you could download again if you like.

When you say:

Quote:where I used another page for input of that tag, like in your description

Do you mean the little tab down the bottom of the text box (named main and sidebar respectively in this case) or a totally new page (ie created a new page named sidebar?)?

I ask because I'm not sure what you mean when you say "Also, in such a configuration it should be clear from the page manager what sections are part of one page.."

Could you expand on that? Thanks checking this plugin out and for the feedback too!
Reply
#4
Hmm, doesnt seem to be working for me. Installed a fresh copy of 3.1.2, added this plug-in.
I see a green "Main" button below the content area of a page, but I am not able to click it.
Tried adding a new page, and the same thing happens.
Line 71 reads:
Code:
echo exec_filter('content', $SEI_RAW_CONTENT_DATA[bling($field[0])]);
I tried to replace it with the code above, but then there is an error, and I am not able to view the admin area.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#5
islander Wrote:Hmm, doesnt seem to be working for me. Installed a fresh copy of 3.1.2, added this plug-in.
I see a green "Main" button below the content area of a page, but I am not able to click it.
Tried adding a new page, and the same thing happens.
Line 71 reads:
Code:
echo exec_filter('content', $SEI_RAW_CONTENT_DATA[bling($field[0])]);
I tried to replace it with the code above, but then there is an error, and I am not able to view the admin area.
Oh, don't replace that code. That problem was for an earlier version where I messed up. I fixed it now!

Green means it is already selected. Smile

The main tab is the default one. If you don't add any new tags (like the one below) to the template that is all you'll have. This is normal.
If you only have a single tab, it's purely cosmetic as you cannot switch to anything else so clicking it will do nothing. Once you get more tabs, the green one will be the currently active one.

To get more tabs, put this tag somewhere in your template, where you want more content (ie in a sidebar or something). Place any name you want in the brackets:

Quote:<?php insert_page_content("sidebar"); ?>

Also make sure you have the same tag with empty brackets in the main section of your page:

Quote:<?php insert_page_content(); ?>

Then go back to your page edit screen and you should have some new tabs down the bottom with which you can click to change.

Let me know how it goes! This is my first plugin, so if it does work let me know what you think too. I'm curious if you guys using it are enjoying it or shelving it. Heh.
Reply
#6
jason.dixon.email Wrote:Hmm looks like I might have messed with something when I changed things around to let plugins change the data.
On line 71 or so can you see this line:

Code:
echo exec_filter('content',$data);}

Replace it with:

Code:
echo $data;}

That should undo my change I think. Sorry about that. Confused
Also I have re-uploaded the file, so you could download again if you like.

When you say:

Quote:where I used another page for input of that tag, like in your description

Do you mean the little tab down the bottom of the text box (named main and sidebar respectively in this case) or a totally new page (ie created a new page named sidebar?)?

I ask because I'm not sure what you mean when you say "Also, in such a configuration it should be clear from the page manager what sections are part of one page.."

Could you expand on that? Thanks checking this plugin out and for the feedback too!

Well as I see it: there are one or more pages in a website. Normally every page is one page in the page management. In the configuration of this plugin you use multiple pages and use them as content fields in one or more pages (right?), or... Anyway, I find it a bit confusing..
Reply
#7
datiswous Wrote:Well as I see it: there are one or more pages in a website. Normally every page is one page in the page management. In the configuration of this plugin you use multiple pages and use them as content fields in one or more pages (right?), or... Anyway, I find it a bit confusing..

Oh, nono. Each page is still one page in management per one page on the web.

Within each page contains all the content for the page. But that content is separated by a number of tabs (located below the edit box).

If that makes sense?

Each named tab corresponds to a section of content on the page. But it is all contained within the one page.
Reply
#8
Hello Jason,

Thanks for your contribution Smile

I haven't really had time to experiment with it much yet, but I did notice that for each version, you need to update line 33, otherwise in the plugin page it always shows that there is an update available.

Also, for future consideration, if you could add the text in language files, for those of us in multilingual environments.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#9
jason.dixon.email Wrote:Each named tab corresponds to a section of content on the page. But it is all contained within the one page.
Basically this plugin is some sort of simplified customfields ? Smile
Addons: blue business theme, Online Visitors, Notepad
Reply
#10
islander Wrote:Hello Jason,

Thanks for your contribution Smile

I haven't really had time to experiment with it much yet, but I did notice that for each version, you need to update line 33, otherwise in the plugin page it always shows that there is an update available.

Also, for future consideration, if you could add the text in language files, for those of us in multilingual environments.

Oh I missed that! Dammit haha. Thanks for pointing that out. I'll re-upload now with that as the only change.

What is the best way of adding text in the language file? Just making a separate file with every sentence written in the plugin? I like the idea of the plugin being self contained by default. Maybe I can add the english version in the plugin itself and have it search out other language files should they exist?..
Reply
#11
yojoe Wrote:
jason.dixon.email Wrote:Each named tab corresponds to a section of content on the page. But it is all contained within the one page.
Basically this plugin is some sort of simplified customfields ? Smile

Yeah I suppose so. I haven't used custom fields yet, but it sounds similar.

What I've tried to do with this plugin is keep the options to a minimum. It will automatically create fields based on what you have added in the template. Then all you do is use them.

It's my first plugin so it's not too complicated. Pretty much everything used in the plugin, I learned while making it. Haha.

Let me know what you think when you do try it though. I'd like to make it a decent plugin. So if there is something you think could change I'm happy to listen!
Reply
#12
Updated to 1.4 and added some i18n support. Currently it's just in the file itself, so if you want to translate it, open the file in a text editor and scroll right to the bottom. If you can post a translation up here I'll add it into the file directly. Otherwise I'm considering having translations as a separate file, as per convention. All depends on demand.

Added a preview link so you can easily preview the location of Tabs on your page. Fun times!!
Reply
#13
Separate files would be a good thing. I will try to get you Spanish in the next day or so.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#14
Spanish lang...
Code:
// Spanish
case 'es_ES': // insert language "name" ie: en_US for english.
$SIT_I18N_LOCAL = array(
// Nice little message in the source code
'SIT_ADDED' => 'Agregado por el plugin de Simple Input Tabs',
//name of default tab!
'DEFAULT_TAB' => 'Principal',
// Welcome messages that appear when new pages and/or tabs are opened.
'WELCOME_NEW_PAGE' => '&iexcl;Bienvenidos a la nueva p&aacute;gina!',
'WELCOME_PAGE_BLURB' => 'Quitar este texto y a&ntilde;adir su contenido aqu&iacute;. Abajo hay unas pesta&ntilde;as nombradas. &Uacute;salos para agregar contenido a las diferentes &aacute;reas de su p&aacute;gina web. No se olvide de a&ntilde;adir un t&iacute;tulo a su p&aacute;gina, arriba.',
'WELCOME_TAB_BLURB' => 'A&ntilde;adir el contenido de la secci&oacute;n:',
//error messages
'ERROR404' => 'Error 404: El contenido solicitado no fue encontrado.',
'TAB_RETURN_PROBLEM' => 'Hubo un problema con su pedido de pesta&ntilde;a.',
'DUPLICATE_TABS' => 'Su plantilla seleccionada tiene pesta&ntilde;as duplicadas del mismo nombre.',
'ILLEGAL_TABS' => 'Hay una o m&aacute;s fichas de su plantilla que utilizan caracteres no v&aacute;lidos. Ellos han estado oculta.',
'WARNING' => '&iexcl;ADVERTENCIA!',
//helpful messages
'CURRENTLY_EDITING' => 'Al hacer clic en una pesta&ntilde;a de arriba guardar y cambiar las entradas. Est&aacute; editando el archivo:',
'CHANGE_TEMPLATE' => 'Si cambia la plantilla de p&aacute;gina, necesitar&aacute; que guardar para actualizar sus fichas.',
'TAB_SECTION_NAME' => 'El contenido de esta pesta&ntilde;a va en:',
'PREVIEW_BUTTON' => 'Mostrar ubicaciones de pesta&ntilde;as.',
// preview page
'SECTION_CODE' => 'Esta secci&oacute;n est&aacute; poblado por el c&oacute;digo:',
'REPLACE_CODE' => 'Para funcionar bien, debe cambiar el c&oacute;digo a:'
);
break;


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#15
Very awesome! Thank you! Smile

Have you had a chance to use the plugin yet? Any suggestions for improvement?
Reply
#16
Still adjusting myself to it. So far so good. Will let you know in the next day or two of any suggestions. Thanks.


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#17
jason I really like your concept of doing the calls in the template. As you can see here this is a wish for future core of me.

I use the I18N Custom Fields plugin which has nice possibilities to setup different input fields:
[Image: I18NCF.png]
I would like to see these possibilitites also in Simple Input Tabs.

I have installed Simple Input Tabs in a new GS test installation with many other plugins to test, however something seems to be strange (maybe problem with another plugin):
[Image: sit.png]

By clicking on "Display Tab Locations." either the main content is showed two times or this message appears below them:
This section is populated by the code:
<?php get_page_content(); ?>
For proper functionality you should change the code to:
<?php insert_page_content(); ?>


This is the template code section (standard innovation template):
Code:
<!-- title and content -->
                <h1><?php get_page_title(); ?></h1>
                <?php get_page_content(); ?>
                <?php insert_page_content("SecondContent"); ?>
                <!-- page footer -->

I use Firefox as Browser. Maybe you can look over this.
Advanced HTML5 & CSS3 coder. Simple JS & PHP hacker (not enough for new function coding). Build one webpage with GS (late 2012). Focusing on Theme customizing/Template files. Experience with WP.
Reply
#18
Hey hey.

I'm glad you are liking it! Smile

When you say you want the option to change input fields, do you mean to replace the main edit box? As in, an 'image' field might just have an image upload button and nothing else?

Initially when making the plugin I thought about that and just figured it was best to keep it as flexible and simple as possible. After all, you can sill insert images/make links etc in the main content box. The only thing on that list you can't do is make a drop-down and check-box.

If it is desired to have different fields I'll see what I can do. I'm not sure if replacing the editor is going to be technically possible (though I have some ideas), but I'll see if I can find a way. What sort of fields would you use from that list?

----

Hmm... ok well first things first. The message in your screenshot that says "Add your content to the section: Secondcontent." is correct. It's the default message when you access an empty tab for the first time. So that looks ok.

That display tab warning, about changing get_page_content to insert_page_content is showing up because you are using get_page_content() in the template. Currently there is some limited functionality with that command as to not break a template that hasn't been modified for this plugin. But as soon as you add any plugin specific commands (in this case insert_page_content('secondcontent'); ) you'll also need to change the get_page_content command.

Give that a go and let me know if it works for you. Smile
Reply
#19
Hello Jason,

Everything seems to be functioning fine. It just took me a bit to acclimate myself to this handy little plugin.
I personally dont see the need for field types, as I believe the custom fields extension serves a different purpose. Also, as you said, you can add images via the tool bar. You can also switch to html, if you need to add something special. Maybe if they were using one field for Youtube, etc. and always wanted a non wysiwyg field?

About the only thing I can really think of is maybe a shared block. For example, you have three fields: main, sidebar, footer. For each page the Main and Sidebar are unique, but the footer is the same for all, but can be edited within any page. Maybe a check box to mark it as shared, and that same box would show up in all pages. I dont know if I am explaining that clearly or not?

Regards


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#20
islander Wrote:Hello Jason,

Everything seems to be functioning fine. It just took me a bit to acclimate myself to this handy little plugin.
I personally dont see the need for field types, as I believe the custom fields extension serves a different purpose. Also, as you said, you can add images via the tool bar. You can also switch to html, if you need to add something special. Maybe if they were using one field for Youtube, etc. and always wanted a non wysiwyg field?

About the only thing I can really think of is maybe a shared block. For example, you have three fields: main, sidebar, footer. For each page the Main and Sidebar are unique, but the footer is the same for all, but can be edited within any page. Maybe a check box to mark it as shared, and that same box would show up in all pages. I dont know if I am explaining that clearly or not?

Regards

I agree. You can really do everything with the WYSIWYG editor. Having said that, I'm working on a compromise currently, for which I'm almost finished.

Shared content. Like a copyright? Or Logo / title, or something? I like your thinking.

It's not immediately obvious, I guess, but that functionality already exists. ;-)

Though... it's not as simple as adding a check box. I might be letting down the simple theme of this plugin! Haha.

You can do this currently if you have a page to edit the common tabs in. For example if you made a page and called it "shared" or choose an existing page maybe. Then in the templates you want the shared content to exist, put the tag:

Quote:<?php insert_page_content("shared->sometab"); ?>

Where "shared" is the name of the page you want to access, and "sometab" is the tabname on that page you want to display. It will place the content from that specific page and tab in the location on every page that uses the template (so long as the page continues to exist and remains the same name).

Oh and I've credited you by the name 'islander' for the translation. Is that ok? Smile
Reply
#21
Hello again,

So it sounds like the feature I was thinking of is already there then. So, for example, you could have a page named "Headers and Footers" with two tabs and omitting this page from any menu. Then in your main template:
Code:
<div id="header"> <?php insert_page_content("headers_and_footers->header"); ?> </div>

Is this correct, you would use the page slug then the tab name?

If so, cool, its already there. What else have you hidden from me? Wink


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#22
islander Wrote:Hello again,

So it sounds like the feature I was thinking of is already there then. So, for example, you could have a page named "Headers and Footers" with two tabs and omitting this page from any menu. Then in your main template:
Code:
<div id="header"><?php insert_page_content("headers_and_footers->header"); ?></div>

Is this correct? You would use the page slug then the tab name?

Yep thats the one.

SIMPLE!

What have I hidden? Well I'm about to hide even more from you with an update. Wink

This is kind of what I'm aiming for with the plugin too, so I'm glad it's happening as intended. Simple on the outside for the template maker, and CRAZY SIMPLE for the user.

But with an added layer of flexibility under the hood, intended to empower the person making templates by giving them control over the user experience.
Reply
#23
Very nice.
Thanks for you time and energy in creating a simple and useful addition to this cool little program.

I look forward to your next update. Smile


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply
#24
islander Wrote:Very nice.
Thanks for you time and energy in creating a simple and useful addition to this cool little program.

I look forward to your next update. Smile
You're welcome. Smile

AND HERE IT IS!

---------
Changes 1.5 - IMPORTANT: Due to a reasonably major change in the way the plugin handles data, you will need to perform a small manual adjustment to all pages created using versions 1.4 or earlier. Navigate to your CMS's root directory and follow this path to the pages folder "/data/pages". From there open up every page made before 1.5 with a text editor. Search for and delete this text:

Code:
||]Main[||

You will not lose data, but it will be hidden if you do not perform this change. Now, onto the changes:

Fixed a bug where tab names would show up in page descriptions, if the description was left blank. The plugin will auto fill in your description if you do not add anything, upon saving.

Fixed a bug where changing the language would hide your main content. The main content tab is now dynamic and will change based on what language you are using.

Improved i18n functionality. The plugin now accepts external language files, and if none exist it defaults to an internal language. Packaged with the plugin is a folder structure with a language file. You DO NOT need to install this folder in order for this plugin to work. If it cannot find the file it will resort to a built in language. However if you want to add a new language, you must abide by the folder structure presented (simply upload the folder and edit/copy the language file "en_US.php").

Added a new built in language. Spanish. Translated by islander. Thank you! Big Grin

Added "blurb" functionality. insert_page_contents now accepts a second parameter that will display what is written as the default text in a new tab and under the tab name in the 'tab locations' page. Your imagination is the limit, but you can use it when a tab name isn't descriptive enough to direct a users content. An example usage:

Code:
<?php insert_page_content("logo","Insert company logo here. No text please."); ?>
Reply
#25
I have a quick question about tabs and switching langs. If I am using it in English populate the pages/tabs, but another user who is using another language goes to edit, it will be distinct because of chosen editor lang?
I didnt quite follow what you were saying there. :/


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply




Users browsing this thread: 3 Guest(s)