Page 1 of 1

Add New text field on Page Content editing.

Posted: Thu Sep 23, 2010 8:45 pm
by Dar
Hi,
I want to add a new single line text field on the page content editing.
The value in the text will show in the page as variable that I'll diced where to place it.

There is a module for it? If there is not module can do it how can I do that?a

Re: Add New text field on Page Content editing.

Posted: Fri Sep 24, 2010 8:48 am
by NaN
Place this in your template:

Code: Select all


{content block="my_text_field" label="Enter some value here" online=true assign="my_var"}
{$my_var}

Save it and see what happens if you edit a page that uses this template ;)
For more info about that search for content blocks in the forums or just read the manuals. (e.g. the demo text that was created on install)

Re: Add New text field on Page Content editing.

Posted: Sun Sep 26, 2010 7:07 pm
by spcherub
Nan,

There was a typo in your solution (one that I make all the time which is why I caught it).

It should be:

Code: Select all

{content block="my_text_field" label="Enter some value here" oneline=true assign="my_var"}
{$my_var}
(Changed "online" to oneline")

Sanjay

Re: Add New text field on Page Content editing.

Posted: Sun Sep 26, 2010 7:24 pm
by NaN
Doh! :D

Re: Add New text field on Page Content editing.

Posted: Wed Sep 29, 2010 8:22 am
by Dar
Thanks!

I'v put this strings in the template, Every page get different value.
How can I make same value in every page that contain the same template.
I want it to change from one page and second page I'll see the values.

btw, there is option to put few string input in the same form on the page edit panel?
or something to order them in the form?
I have 20 variable, Isn't look so good in this list.

Re: Add New text field on Page Content editing.

Posted: Wed Sep 29, 2010 8:56 am
by NaN
Dar wrote:
How can I make same value in every page that contain the same template.
So you want to have a kind of global content block that can be edited in every page?
Is not that easy. I believe it is just out of scope at the moment.

Btw. what do you need this for?

Dar wrote:
btw, there is option to put few string input in the same form on the page edit panel?
or something to order them in the form?
I have 20 variable, Isn't look so good in this list.
Try AdvancedContent module.
Latest alpha release can be downloaded here.

Re: Add New text field on Page Content editing.

Posted: Wed Sep 29, 2010 11:53 am
by vitalikaz
Hello all,
I'm using default theme after installing cmsms (NCleanGreyTheme), and I need to add a single line in Edit Content -> Main page (actually, just copy 'Description' field from the Options tab). Where can I find the template file, that is used by editcontent page?

Code: Select all

> cd [root]/admin/themes/NCleanGrey/
> ls
css  docs  images  includes  index.html  login.php  NCleanGreyTheme.php  vector
and

Code: Select all

> cd [root]/admin/templates
> ls
changegroupperm.tpl  index.html                 systeminfo.tpl
changeusergroup.tpl  listcssassoc.tpl           systeminfo.txt.tpl
checksum.tpl         multicontent_template.tpl
copycontent.tpl      siteprefs.tpl
Can't see anything, that would help me :(

Thank you

Re: Add New text field on Page Content editing.

Posted: Wed Sep 29, 2010 12:04 pm
by NaN
vitalikaz wrote:
Can't see anything, that would help me :(
Then you must be blind.
Did you actually read this topic or searched in the forum for additional fields in the backend when editing a page? Did you even recognized the link to the AdvancedContent module that i provided right before your post? Did you read the help of the {content} tag? (Admin: Extensions->Tags select {content})

What you need is this in your page template:

Code: Select all


{content block="my_description" label="Description" wysiwyg=false}

When editing a page this will show you a textarea without wysiwyg editor labeled "Description".

There is no need to modify any core files.

Btw. i wouldn't expect any help on modifying the core files of CMSms in a forum that does not provide any support to modifications but only to the original install of CMSms.

Re: Add New text field on Page Content editing.

Posted: Wed Sep 29, 2010 12:12 pm
by vitalikaz
Damn, thank you! :) I'll be more observant next time.

Re: Add New text field on Page Content editing.

Posted: Wed Sep 29, 2010 12:34 pm
by Dar
NaN wrote:
Dar wrote:
How can I make same value in every page that contain the same template.
So you want to have a kind of global content block that can be edited in every page?
Is not that easy. I believe it is just out of scope at the moment.

Btw. what do you need this for?

Dar wrote:
btw, there is option to put few string input in the same form on the page edit panel?
or something to order them in the form?
I have 20 variable, Isn't look so good in this list.
Try AdvancedContent module.
Latest alpha release can be downloaded here.
I need it for small packges style I build for the site so the admin, can add/edit content without changing the html style.

I need to show it every page.
I didn't find anything about global content that would use the vars as a global.