Field Editor

24 posts by 2 authors in: Forums > CMS Builder
Last Post: December 27, 2007   (RSS)

By Djulia - December 24, 2007 - edited: December 24, 2007

Hi Dave,

I have two new questions.

1) It would be possible to place fields hidden (type="hidden") in Field Editor ?

Field Type : hidden

For example, I would like that the editor gives a value, but not the user.

2) My second question relates to the field list.

Field Type : list (pulldown)

a) When the user edit the page again, the value is not preserved.
The user must again select the value. It is a bug ?

b) It would be possible to apply the Unique option ?

Thank you for your assistance.

Djulia

Re: [Djulia] Field Editor

By Dave - December 24, 2007

>1) It would be possible to place fields hidden (type="hidden") in Field Editor ?

Not right now, what would you like to use that for? Or what are you trying to achieve?

>Field Type : list (pulldown)
>a) When the user edit the page again, the value is not preserved. The user must again select the value. It is a bug ?

The value should be preserved, that's what happens when I test. Can you post some of your options so we can try and recreate the problem on our end? If we can recreate it we can fix it.

>b) It would be possible to apply the Unique option ?

We can add that feature, it would limit how many records you could have, though, to the number of list options. Because each record could only have one unique option.

Can I ask what you want to use that for?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Field Editor

By Djulia - December 25, 2007

Hi Dave,

Here what I try to obtain

Admin == Jack
User == Virginia

Section == Admin > Section Editors > Add a new menu... > Blog

In Admin > Section Editors > modify (Blog) > Add Field :

Field Label == Order
Field Name == order
Field Type == list
Display As == pulldown
List Options == 1, 2, 3, 4

I created as administrator (Jack) in my Blog section :

Page 1 (order == 1)
Page 2 (order == 2)
Page 3 (order == 3)
Page 4 (order == 4)

Now, Virginia is connected on the Blog section.
Virginia can modify the order of the pages.
If Order were of hidden type, it would be possible to prohibit Virginia from modifying the order of the pages.

But, there is perhaps another solution that the use of a field hidden to prohibit the user (Virginia) from modifying a field ?

Question 2

It would be possible to prohibit the user (Virginia) to modify or delete a page in the section (Blog ) ?

Admin
Page 1 (order == 1) - modify
Page 2 (order == 2) - modify
Page 3 (order == 3) - modify
Page 4 (order == 4) - modify

User
Page 1 (order == 1) - no modify
Page 2 (order == 2) - modify
Page 3 (order == 3) - modify
Page 4 (order == 4) - modify

-----

You think that there is a possible solution ?

Thank you for your answer.

Djulia

Merry Xmas, and a Happy New Year Everyone[/#0080c0] [:)]

Re: [Dave] Field Editor

By Djulia - December 26, 2007 - edited: December 26, 2007

Hi Dave,

Thank you for your answer. [:)]

An answer for question 2, would also give a solution for another problem.

By default blogPage.php (Page Viewer) takes value 1 ($options['recordNum'] = '';).

If the user (Virginia) delete the recording 1, blogPage.php (Page Viewer) uses the condition :

<?php if (empty($record)): ?>
No record found!<br/><br/>
<?php endif ?>

1) If the admin (Jack) can prohibit to delete page 1, it would be possible to preserve the value of ($options['recordNum'] = '';).

2) If not, how the user can indicate a value for ($options['recordNum'] = '';) without editing the code in blogPage.php (Page Viewer).

Thank you for your feedback.

Djulia

Re: [Dave] Field Editor

By Djulia - December 26, 2007

Would a suggestion, it be possible to use ($options['recordNum'] = 'order';) ?

Thank you for your feedback.

Djulia

Re: [Djulia] Field Editor

By Dave - December 26, 2007

If you wanted to show the first record that exists, sorted by order, you could use the list viewer to show just one record with these options

$options['pageNum'] = '1';
$options['perPage'] = '1';
$options['orderBy'] = 'order';


What do you want displayed when the user visits blogPage.php?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Field Editor

By Djulia - December 26, 2007 - edited: December 26, 2007

Thank you for your answer.

Here my project (Blog is a section).

Home - Record Number: 5 - /blogPage.php/Page_2-3 == (order 1)
Page 1 - Record Number: 4 - /blogPage.php/Page_1-4 == (order 2)
Page 2 - Record Number: 3 - /blogPage.php/Page_2-3 == (order 3)
Contact - Record Number: 2 - /blogPage.php/Contact-2 == (order 4)

Now, if the URL /blogPage.php is visited, it has the message : No record found !

It would be possible to have recording 5 (Home) ?

In my /blogPage.php file, I added $options['recordNum'] = '5'; line 61.
But all the pages have then this value.

Djulia

P.s. : You can delete the attached files, if it is not authorized on the forum.
Attachments:

blogpage.php 6K

capture1_001.gif 44K

Re: [Djulia] Field Editor

By Dave - December 26, 2007 - edited: December 26, 2007

Hey, nice design. :)

So, a few things. First off, the page viewer defaults to record 1 if no record is specified, so to use record 5 by default you can add some code like this at the top:

$numFromUrl = getNumberFromEndOfUrl();
if (!$numFromUrl) { $numFromUrl = 5; }


That will set $numFromUrl to the number on the end of the url or use 5 as the default. Then pass that to the list viewers as an option like this:

$options['recordNum'] = $numFromUrl;

Give that a try and let me know if it works.

It looks like you have the block that calls getRecord() twice, you should be able to remove the second one.

Also, once you get it working, you can actually have the urls look like whatever you want. For example, they could be like this:

blog.php (shows home)
blog.php/home
blog.php/page1
blog.php/page2
blog.php/contact


And you could have a pulldown that specified what page type each record was. If you want help with that later let me know.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Field Editor

By Djulia - December 26, 2007


It looks like you have the block that calls getRecord() twice, you should be able to remove the second one.




I wished to delete it, but that poses a problem.

All the pages give the same recording.

And if I delete the first, I cannot use <?php echo $record['title'] ?> for the title.

With is your opinion, it a bug ?

Djulia