This topic is locked

How to reuse customized pages in a View

5/12/2008 11:39:29 AM
PHPRunner General questions
P
patc888 author

I've created a view and have customized the List page.

Basically, I tried to save space by moving all the links -

Edit, Inline Edit, View - into a single column.

(Eventually, I want to make them small icons, but that's later).
My question is whether I can reuse this customization on all

the other List pages in all the other 50 Views I want to build?
Or do I have to do this for each and every one?
Thanks

A
alang 5/12/2008

You can create your own customised layout template and then edit the list htm files. This will then be applied to all list pages in your project.

P
patc888 author 5/12/2008

Thanks for the info.

Do you know where this .html file is?

S
swanside 5/13/2008

Thanks for the info.

Do you know where this .html file is?


WHen you build your project, open the output folder. There you will see a folder called Templates. In here you will also see the html files for all the pages.
Lets say you create a custom field called fish? ( Dont know why I thought of that ) and you have all your links on it. In the templates folder you will see a html file, fish_view.html Open this with your web page editor, I use MS Frontpage and make your changes, putting the links where you want them, then save it.
Just for future use, make a new folder called My Files and copy the file you have changed into this folder, as everytime you rebuild your project, it will overwrite the file you have changed. It is just a case of going into My Files folder in he output directory and coping the file back.

P
patc888 author 5/13/2008

Is there a way that isn't destroyed each time I rebuild the project (which is about every 10 minutes).
Thanks

S
swanside 5/13/2008

Is there a way that isn't destroyed each time I rebuild the project (which is about every 10 minutes).

Thanks


Yeh, Like I said, make a copy of them and put them in a new folder in your output directory, and just copy them from your new folder into your templates folder.
As far as I know it just rebuilds all the files when you re-build it.

A
alang 5/13/2008

The available layout templates are stored (typically) in "C:\Program Files\PHPRunner4.2\templates\layouts".

  1. Create a new folder in this directory - say "MyCustom"
  2. Copy an existing template that you want to base your custom one on by copying all the files from the appropriate folder (say "London")
  3. Under your new folder edit the relevant htm file. Note that the list view now has three files - lheader.htm, lfooter.htm, and list.htm or list_vertical.htm - the latest version (4.2) broke these up to provide a common header and footer section to both types of list template.
  4. In PHPR on the "Choose theme" tab, you will then have the option to select "MyCustom" in the "Choose Layout" panel
    This approach will apply your custom list layout to all list pages in your project without needing to do anything "post build". Note that this folder is also left alone if you update your PHPR install. I also maintain this folder in a CVS repository.

P
patc888 author 5/14/2008

perfect!
thanks,

pat

G
garethpDevClub member 5/14/2008

Hi All
I have been following this topic with great interest as it is something I am interested doing but not able enough myself !!!
I was wondering if someone would be able to help with a coulpe of related questions...

  1. I would like to change the "view" "copy" "inline edit" links on the list pages to just be "v" "c" "ie" etc to save space and look better. I have looked in the list.htm file but just can not see where this could be done. Obviuosly I could do it in the visual editor but this have to be done on every page and result in massive rebuild issues.
  2. I would also like to change the text to use pictures for these links rather text - have you achieved this and can you give any guidance?
    I would be very appreciatvie of any help as this is one of the missing linkg (no pun intended) for me to make the visual side of PHPR fantasitc.
    Many thanks in advance.
    Gareth

J
Jane 5/14/2008

Hi,
try to edit following code in the list.htm file:

##if @TABLE.bView##

<td align="center" valign=middle>

<a href="##@TABLE.strShortTableName h##_view.##@ext##?" id="viewlink_add" class=tablelinks2>

##message VIEW##</a>

</td>

endif

G
garethpDevClub member 5/14/2008

Jane
Thanks for the reponse
I have tried edit as follows
from

message VIEW##



to

message V##



but had not luck - the "view" link just disappears when I rebuild
SORRY - ANY MORE HELP?

J
Jane 5/14/2008

Gareth,
replace ##message VIEW## with V in the above code.

G
garethpDevClub member 5/14/2008

Jane
Great that works a treat but now you have got me experimenting!!!
I want to change the text for an image and ammended the code as follows...

##if @TABLE.bView##

<td align="center" valign=middle class=borderbody>

if @TABLE.nRecordsPerRow>1##<!--{if $row.##@i##show}-->##endif##

<a class="tablelinks" href="##@TABLE.strShortTableName h##_view.##@ext##?{$row.##@i##editlink}" ##if @TABLE.bInlineEdit## id="viewlink{$row.##@i##recno}" ##endif##><img src="include/img/icon_view.gif"></a>

if @TABLE.nRecordsPerRow>1##<!--{/if}-->##endif##

</td>

endif


and removed the ##message VIEW## completely
This seems to work and lets me click the image to view the record expect the image has a blue border around it.
Please help if you can as this is the final piece for my jigsaw.

J
Jane 5/14/2008

Please see my changes in Bold:

##if @TABLE.bView##

<td align="center" valign=middle class=borderbody>

if @TABLE.nRecordsPerRow>1##<!--{if $row.##@i##show}-->##endif##

<a class="tablelinks" href="##@TABLE.strShortTableName h##_view.##@ext##?{$row.##@i##editlink}" ##if @TABLE.bInlineEdit## id="viewlink{$row.##@i##recno}" ##endif##><img src="include/img/icon_view.gif" border=0></a>

if @TABLE.nRecordsPerRow>1##<!--{/if}-->##endif##

</td>

endif

G
garethpDevClub member 5/14/2008

Jane
You are a genius - fanatastic, brilliant. So happy!!!!!!!!
Take care and many many thanks for such amazing support
Gareth

P
patc888 author 5/14/2008

gareth, any chance you could share this layout with the rest of us? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=29278&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

the built-in layouts take up soooooo much space for these operations.
cheers,

pat

G
garethpDevClub member 5/15/2008

Pat
Take a look at www.intaakt.co.uk/sonic
Log in as

username: guest

password: password
Don't worry all all the other template colur changes I have made - I have only just discovered how to do this and am 'playing' to create myself a template but have not finished yet!
You will see I have replaced the "view" "edit" "inline-edit" with a gif image that you can click. I am not very good at design software so these images are the best I could achieve!
Customers tab shows all the images - inline edit not on others
I only did this yesterday so have not had time to test in full but is what you are after knowing how to do?
If it is I will be glad to help where I can (my only experience of web sites is PHP Runner which I love). I can talk you through the changes as they are very easy - if I can do it anyone can - and always useful to know how things are done I think.
Gareth

S
swanside 5/15/2008

If it is I will be glad to help where I can (my only experience of web sites is PHP Runner which I love). I can talk you through the changes as they are very easy - if I can do it anyone can - and always useful to know how things are done I think.

Gareth


Sorry Gareth, I had to have a look aswell.
I like the changes in the colour and background.
Any chance you could share with me how you changes the templates?
Cheers
Paul.

G
garethpDevClub member 5/15/2008

Paul
No worries this is what the forum is for - much easier to do on email so I can give you examples/picutres etc.
Go into intaakt.co.uk/sonic and add yourself as a customer - add you email address in the account field - this field only appers on the add screen so noone else will be able to see it.
Username : guest

password: password
Gareth

S
swanside 5/15/2008

Paul

No worries this is what the forum is for - much easier to do on email so I can give you examples/picutres etc.
Go into intaakt.co.uk/sonic and add yourself as a customer - add you email address in the account field - this field only appers on the add screen so noone else will be able to see it.
Username : guest

password: password
Gareth


CHeers Gareth, I didnt read your instructions correctly so I did it twice.
Cheers

Paul.