1
Bender
The good, the bad and the templates. (How to change templates)
  • 2005/7/19 22:20

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


Ok maybe this thread might evole into what the title says.

After meddling with templates for more than one hour without any luck again (happened in the past too) i have to do a check if my understanding of the way templates work (not what they are) is correct or if i am completely off track.


Scenario:

Trying to remove some text being displayed from a page.
Ok .. found the template file ... found the line with the variable for the text. Am quite sure i have the right file as preview in HTML editor shows this to be the only template looking the way the real page looks.

[Edit:]Update module template .html files from themes/your theme/templates directory is set to yes in site preferences


Attempt one:

- using a cloned template set (which is set in site prefs)
- go into templates; press edit; remove the line and submit
- go into edit for that file again ... line is gone. ok great
- deleting all content in templates_c directory
- calling up the page ... no change
- using another browser (to avoid browser cache) ... no change


Attempt two:
- editing the file locally
- uploading the file overwriting the original one
- go into templates - cloned templates - deleting this files template
- regenerating this files template
- deleting all content in templates_c directory
- calling up the page ... no change
- using another browser (to avoid browser cache) ... no change


Attempt three:
- trying same way as one and two again just additionally updating the the module this time
- same result ... nothing


Attempt four:
- cloning my cloned theme
- activating the cloned cloned in site prefs
- editing the file template to check if the line is out and yes it is
- updating the module
- deleting templates_c
- calling up the page ... no change
- using another another (so the third) browser (to avoid browser cache) ... no change


Attempt five:
- editing the file locally
- uploading the file overwriting the original one
- switching site to default template
- updating the module
- deleting all content in templates_c directory
- calling up the page ... no change
- using another browser (to avoid browser cache) ... no change



This leaves the assumption that i either completely missunderstand this templates thing or that i switch into a paralell universe when i use the browser to check and in that universe i did not change anything, then switch back to the other universe when i look at the file itself again.


Ok checked the dev wiki, did a search, read the faq entry but it did not really bring me the answer.

So here is a short form of how i understood it and now i need someone to tell me where i am completely wrong:

=====================================================

1. Install a module - templates get written in the db (default template set)

2. To change the template in the "Default" set the only way would be to
- edit the template file
- update the module
- (clear templates_c to avoid getting served the old one for some time)

3. To change the template in a cloned set i could either
- go as described in 2.
- or just go into the cloned template set, click edit for that template, change it and click submit
- again clearing templates_c should be done


So whats wrong about this thinking?
Sorry, this signature is experiencing technical difficulties. We will return you to the sheduled signature as soon as possible ...

2
pod
Re: The good, the bad and the templates. (How to change templates)
  • 2005/7/19 22:32

  • pod

  • Quite a regular

  • Posts: 301

  • Since: 2003/4/19


Have you tried just enabling 'Update module template .html files from themes/your theme/templates directory?' in System Admin > Preferences > General Settings, before editing your cloned template files?
www.myxoops.com - MyXoops Is Your XOOPS!

3
Bender
Re: The good, the bad and the templates. (How to change templates)
  • 2005/7/19 22:38

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


Yeah forgot to mention that. Yes its active.
Sorry, this signature is experiencing technical difficulties. We will return you to the sheduled signature as soon as possible ...

4
pod
Re: The good, the bad and the templates. (How to change templates)
  • 2005/7/19 22:51

  • pod

  • Quite a regular

  • Posts: 301

  • Since: 2003/4/19


Well your process seems sound, although to edit my templates I just:

- Clone a template set
- Set the cloned templates to the 'default' set in Admin > Preferences > General
- Set 'Update module template .html files from themes/your theme/templates directory?' to 'yes'
- Go to System Admin > Templates > Module > whatever.html > Edit
- Make changes, hit submit

...& thats it, no updating modules or erasing templates_c.

Templates used to baffle me, I would download the entire 'templates_c' folder & edit the html files & then overwrite the edited template files directly - which was a tremendous pain vs the method described above. Still have issues exporting/importing templates, sometimes I will export & think I have a backup & go to use it & find that the exported gzip has 0 bytes... but sometimes it works.

*shrugs*
www.myxoops.com - MyXoops Is Your XOOPS!

5
adrock
Re: The good, the bad and the templates. (How to change templates)
  • 2005/7/20 0:49

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


I came across this the other day, and the solution I come up with was:

Download the template for the item you are changing from the templates area of the admin module.

Make a copy of the file (just in case), make your edits, and save the file.

Now, go back to the templates area of the admin module and delete the template you just alterred locally.

Do all of the temp cleaning and page reloading etc.

Go back to the admin module and upload the new template....don't 'generate it', because if you do that it will pull it from the modules folder of templates (the one you haven't changed).

that did the trick for me....
why? Best I could figure with all the poking around I did was that the database actually writes all of the html to the database....for whatever reason, not all modules work with XOOPS to re-write all of the info back to the database when you alter the templates. So, in the method above, you are removing the template from the database completely, and re-generating it...which in turn makes the change visible
Affordable Web Hosting - Family - Fun!...and not always in that order!

6
Springanew
Re: The good, the bad and the templates. (How to change templates)
  • 2005/7/23 22:17

  • Springanew

  • Just popping in

  • Posts: 34

  • Since: 2005/4/12


Quote:

adrock wrote:
Download the template for the item you are changing from the templates area of the admin module.

Go back to the admin module and upload the new template....don't 'generate it', because if you do that it will pull it from the modules folder of templates (the one you haven't changed).


Thank you so much for posting this. I had the same problems as above and I tried your method and it worked!

Best! - - -
Leslie in San Antonio
www.san-antonio-online.com
www.springanew.com
Using xoops!

7
Bender
Re: The good, the bad and the templates. (How to change templates)
  • 2005/7/23 23:44

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


Thanks ... it works that way.

But:

That can´t be the way it´s supposed to be.
Sorry, this signature is experiencing technical difficulties. We will return you to the sheduled signature as soon as possible ...

Login

Who's Online

93 user(s) are online (55 user(s) are browsing Support Forums)


Members: 0


Guests: 93


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits