Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-03-22 00:08:40
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
"Rebuild Site" button for local/live transfers
I do development on localhost, then dump the database and replace the one for the live site. What keeps getting me hung up is the fact that Txp caches the HTML that results from Textile processing in the database. Any in-site links within articles that use relative paths are therefore stuck until those articles are re-saved. I don’t want to use absolute URLs for these links if I can help it, since that would make them lead back to the live site when I’m working on localhost.
This isn’t a big problem with my current project, since the site is small. On larger sites with many articles, however, this would become a big headache. Could a “rebuild” button be included in the advanced admin options for these situations? Is this the kind of thing that could be done with a plugin?
Offline
#2 2006-03-22 19:21:45
- NyteOwl
- Member
- From: Nova Scotia, Canada
- Registered: 2005-09-24
- Posts: 539
Re: "Rebuild Site" button for local/live transfers
You could always add the following tag to the HEAD portion of your page(s) while working:
<code><base href=“url for base reference in relative links” /></code>
<p>It’s handy for trouble shooting pages remotely too when you download a page but want the relative links to still work.</p>
Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;
Offline
#3 2006-03-22 23:15:11
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: "Rebuild Site" button for local/live transfers
Unfortunately, Txp turns relative links added with Textile (like <notextile><code>click here;) into absolute links in its cached XHTML. I don’t think base href
would do any good in that situation.
Last edited by Logoleptic (2006-03-25 09:50:28)
Offline
#4 2006-05-15 17:23:35
- joshwand
- New Member
- Registered: 2006-05-15
- Posts: 3
Re: "Rebuild Site" button for local/live transfers
I would suggest an option to simply turn html caching off— just do the textile->html translation “live”. Howzaboutthat?
Offline
#5 2006-05-15 18:31:26
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: "Rebuild Site" button for local/live transfers
Textpattern doesn’t cache anything, your browser does.
Offline
#6 2006-05-15 18:37:53
- joshwand
- New Member
- Registered: 2006-05-15
- Posts: 3
Re: "Rebuild Site" button for local/live transfers
textpattern stores the html conversion from the textile in a dedicated column in the database (textpattern.body_html, as opposed to texpattern.body, which stores the textile version). I know this well, because I’ve had to go through each article one by one, clicking on the preview tab, then resaving the article, to get txp to update its cache of the conversion. (e.g. after an import)
Last edited by joshwand (2006-05-15 18:41:59)
Offline
#7 2006-05-15 18:47:47
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: "Rebuild Site" button for local/live transfers
Okay, I get what you are talking about, but I don’t see how that would fix the url problem.
Unfortunately, Txp turns relative links added with Textile (like click here) into absolute links in its cached XHTML. I don’t think base href would do any good in that situation.
No, it doesn’t, it enters the url exactly as you provide it, i.e (view source and you’ll see): click here.
The alternative of use the base tag would be to use html in your article, i.e: <a href="<txp:site_url />contact">click here</a>
.
Offline
#8 2006-05-15 21:54:58
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: "Rebuild Site" button for local/live transfers
Mary wrote:
The alternative of use the base tag would be to use html in your article, i.e:
<a href="<txp:site_url />contact">click here</a>
.
I’m using the zem_link
plugin now, and that’s solved this problem nicely. Does <txp:site_url />
work in the context of an article?
Offline
#9 2006-05-17 01:42:36
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: "Rebuild Site" button for local/live transfers
Does
<txp:site_url />
work in the context of an article?
Yes. It just doensn’t play nice with Textile, hence you’d need to use HTML to make the link.
Offline