Page 1 of 1

Editing .tpl files

Posted: Tue Jun 06, 2006 6:17 pm
by neov
Is there an easy way to do this besides going in manually? It seems that the only way I've found is to go in, edit something, transfer it to the server, and see what I end up with.

Another problem I have with this is that my changes often times look different in IE than it does in Mozilla or Netscape.

For example, when trying to edit out the comments and trackback sections in a category and putting in a link to my forum instead, I sometimes get this:
To leave a comment, please visit our forum

The author does not allow comments to this entry
-->


Frontpage - Top level
The part I don't want is in blue, and it sometimes shows up in Mozilla and not IE, or vice versa.

My receding hairline is receding even more rapidly while trying to figure this out, so any help would be appreciated. :wink:

Re: Editing .tpl files

Posted: Tue Jun 06, 2006 7:47 pm
by garvinhicking
Hi!

No, there is no "frontend" for editing files. This has two reasons:

1. Any decent editor is MUCH better than just a textarea in your browser. Syntax highlighting, autocompleteion etc. is VERY important for successfull coding.

2. Security issues. It would mean that many of your files would need to be writable by the PHP process, plus if someone hacked your s9y interface, he could put any PHP code onto your blog. Currently, if someone has hacked your s9y installation (by getting your password somewhere), it would not necessarily imply that he could alter/edit files on your webspace.
Another problem I have with this is that my changes often times look different in IE than it does in Mozilla or Netscape.
Yes, it's like that. IE has many CSS oddities. You'll always face these problems with HTML webdesign. :)

Your snippet of code shows that you seem to have moved pieces of the .tpl files outside of their foreach loops. Always pay attention that when you move blocks to check their IF/FOREACH structure.

HTH,
Garvin

Posted: Wed Jun 07, 2006 1:26 am
by neov
At the risk of sounding completely ignorant, what's a foreach loop? Perhaps you know of a good tutorial I should look at?

Thanks Garvin. I know dealing with newbies like me must be frustrating at times.

Posted: Wed Jun 07, 2006 3:32 am
by judebert
A foreach loop is a bunch of stuff (the "loop") that gets done once "for each" entry in a list. You just specify the list and what to do with each entry.

For a slightly more detailed explanation of how Smarty works with Serendipity, you might like to look at this Editing entries.tpl template tutorial on the main page.

If you have any other questions, feel free to ask.

Posted: Wed Jun 07, 2006 4:05 am
by neov
Believe it or not, I think it's starting to make sense...

I started to look closely at where I'd put the <!-- and --> to stop the comments, trackbacks, etc. and realized what Garvin was saying and how I wasn't doing what I was supposed to do, I think. I just made some more changes, and it seems way easier this time.

Should I be afraid now? ;)

Thanks for the link to the tutorial. I'm sure that will help as well. :D

Posted: Wed Jun 07, 2006 4:11 am
by judebert
Be afraid. Be very afraid. :lol:

Once it starts to make sense, the urge to make modifications becomes overpowering. That leads to overreaching the limits of HTML, which leads to frustration, which leads to pain. Pain leads to hate. Hate leads to... suffering. :roll:

Seriously, though, congratulations. You're on your way. And we're always here to help you, if you need it.