This topic is locked

Visual Editor - display issue

4/8/2008 6:28:28 AM
PHPRunner General questions
L
Lisa2006 author

Hi Forum,
I've placed the following code snippet within as follows:
global $data;

$value = "<a target=_blank href=\"[http://maps.google.co.uk/?ie=UTF8&hl=e...data"town"]." \"> ".$data["town"]."</a>";

$value = ucwords(strtolower($value));
When executed, it displays correctly within the List and View pages. However on the Edit page it simply produces an error as follows:

<[color=#000080]a Target=_blank Href="http://maps.google.co.uk/?ie=utf8&hl=en&q=london "> London</a>
How can i correct this?
Thank you in advance
Lisa

J
Jane 4/8/2008

Hi,
custom code on the "View as" settings dialog works on the list, view and print pages only.

This code doesn't executed on the edit page.

L
Lisa2006 author 4/8/2008

Jane,
Thank for your reply.
I have a problem. When i remove the code snippet from the Visual Editor: Edit Page: View as custom
or
simply change the view as to "blank" (above short date), it removes any present of the code in the List or View page.
How can i keep the code in the List and View page, whilst removing from Edit page?
Thanks in advance
Lisa

S
spintz 4/8/2008

If you set the "View As" to "Custom View", then set the "Edit As" to "Read Only", the Edit page will use the "Custom View" from the "View As" setting. The only problem with doing this, is that the field cannot be edited anymore and is "Read Only", but I think that's the functionality you want, right?

L
Lisa2006 author 4/8/2008

If you set the "View As" to "Custom View", then set the "Edit As" to "Read Only", the Edit page will use the "Custom View" from the "View As" setting. The only problem with doing this, is that the field cannot be edited anymore and is "Read Only", but I think that's the functionality you want, right?


Hi Spintz,
YES to your question....
Quick summary:
List page will display the town link as per code snippet

View page will display the town link as per code snippet

Edit page is set to read only. Will not need to be edited ... only for display purposes.
Thanks
Lisa

S
spintz 4/8/2008

Cool, then that worked for you?

L
Lisa2006 author 4/8/2008
L
Lisa2006 author 4/8/2008

Hi Spintz,
Sorry it did not work.
Let me please expain again as to what i'm trying to achieve.
I have the following pages: LIST, EDIT & VIEW



I set Visual Editor | List Page | town: "View as" setting to Custom and entered the following code snippet:

global $data;

$value = "<a target=_blank href="[url="http://maps.google.co.uk/?ie=UTF8&hl=en&q="]."</a>";;

$value = ucwords(strtolower($value));
I set Visual Editor | List Page | town: "Edit as" setting to Text field
At this point, when i check the View Page, it is automatically set with the same parameter as the LIST Page.
Great this bit works fine.
However, here's the problem:

When i check the EDIT page, it to has the same parameters as the LIST Page. I want to remove the code snippet from the EDIT Page and make this field READ ONLY. However, when i remove the code snippet and set this to read-only, it also sets the LIST & VIEW page fields to read-only with no code snippet.
Can anyone please HELP!!!
Lisa

S
spintz 4/8/2008

I set Visual Editor | List Page | town: "Edit as" setting to Text field


Why? That should be set to Readonly. I do exactly what you're asking to do, and it works fine for me -
View As -


Edit As -


Remember, View properties are for View/List pages, Edit properties are for Edit pages....UNLESS, you set Edit to ReadOnly, then the edit page will use the View property.