[solved] SelfRegistration or FormBuilder Custom Templates

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
PaulG
New Member
New Member
Posts: 5
Joined: Thu Nov 15, 2007 7:23 pm

[solved] SelfRegistration or FormBuilder Custom Templates

Post by PaulG »

Hi,

I don't want to use the loop  {foreach from=$controls item=control} in the SelfRegistration module Registration Template 1 box.

I want to do something like this instead, input_id}" value="{$controls["last_name"]->post_value}" class="some_class">, can something like this be done?

I did a {$controls|print_r} but don't see how it is indexed.   every documentation page I find seems to be empty.

also, the SelfRegistration admin page could use an 'apply' button above the Registration Template box.

Thanks,

another similar question, might as well add here too,
--------------------------
FormBuilder 'Field Name' or 'Field Label' (suggestion)

This is just a suggestion, sorry if it's already been mentioned,

On the 'Main' tab when editing a form, there is a column called 'Field Name' which is used for the label and also the code field name.  I think this column should be split in two, 'Field Label', 'Field ID',

because what happens if you want a label like 'Last Name', which has a space character in it (or a field with a non alphanumeric like a '?'), but to use it in code you need to name it 'last_name' to do this {$last_name->input_id}

I guess this is only necessary if someone's not using the standard {foreach from=$fields item=entry} loop.

also how can I do something like this? input_id}" value="{$last_name->post_value}" size="{$last_name->size}">

and in the edit field page there is a "Maximum Length:" input box, could add a "Size:" box too.

and under 'Advanced Settings' the 'CSS Class for this field:' should have another css field for the output from {$last_name->input}

I had written this other question below then I realized I don't really need to use the label part anymore, :)  since I'm using a custom template.
---------------------------
FormBuilder Custom Template

I don't want to use the {foreach from=$fields item=entry} loop to list the fields,

in the admin page "Form Fields" list there is a column called 'Field Name', which is really the 'Field Label', if I want a label of 'Last Name' what is the variable name for coding?

I see on the 'Submission Template' tab there is a table of "Variable Field and Represented"
'{$last_name} / {$fld_21} Last Name'

On the 'Form Template' tab it mentions "directly accessing fields by their names (e.g., {$myfield->input} )"

I tried {$last_name->input_id} and {$fld_21->input_id} like this, but didn't work:

Last Name: input_id}" type="text" class="the_class" id="the_id" size="30">

or how can I index the fields array by name?
{$fields|print_r} works
{$fields[0]|print_r} works
{$fields["last_name"]|print_r} doesn't work
---------------------------

CMS Made Simple 1.2.1
FormBuilder 0.4.4
SelfRegistration 1.1.2
Last edited by PaulG on Sat Oct 11, 2008 12:46 pm, edited 1 time in total.
PaulG
New Member
New Member
Posts: 5
Joined: Thu Nov 15, 2007 7:23 pm

Re: SelfRegistration or FormBuilder Custom Templates

Post by PaulG »

Someone sent me a pm asking if I ever solved this, so I'll dig up the old solution I came up with and post,

In the template, remove all the table tags and put each input field in it's own div, then use css to position each one.

here's part of the old code from my template:

{foreach from=$controls item=control}

pg_id_div}">
pg_id_ctrl}">{$control->marker}{$control->prompt} :

{$control->hidden}
{$control->control}



{/foreach}

I might have modified the php code and added things, I think I did this,

In \modules\Other\FEU\FrontEndUsers\function.user_changesettings.php
Add another property to the $onerow and add an appropriate value, (repeat for the other onerows you find).
example:
//Paul
$onerow->pg_id_div = 'feu_input_username';
$onerow->pg_id_ctrl = 'feu_input_usernamei';
$addtext = "disabled='disabled' id='".$onerow->pg_id_ctrl ."' class='form'";

Same idea for the self registration too.
In \modules\Other\SR\SelfRegistration\action.default.php
example:
//Paul
$onerow->pg_id_div = $reln['name'];
$onerow->pg_id_ctrl = $reln['name'].'i';
$addtext .= " id='".$onerow->pg_id_ctrl ."' class='form'";

might have been some other things I modified too, can't remember.  I put a comment with my name in parts of code I change so I can find it again, so I think this is all.

then at the top of your template or in a css file you'll need to add css style positioning for each one,

example:
#feu_input_username {
position: absolute;
left: 20px;
top: 50px;
width: 200px;
height: 22px;
text-align: left;
}

wrap everything in a "container" div with position:relative to make it easier to figure out the top and left for each item.
Post Reply

Return to “CMSMS Core”