Darn, I was hoping there was something cleaner. That seems
to work but
it needed some tweaking first.
I noticed that entry.getlink() builds the url as:
http://yoursite.com/blog/?permalink=Testing.html&a
mp;page=blah
So just a straight conversion isn't enough since it would
end as:
h
ttp://yoursite.com/blog/Testing.html&page=blah
... which is invalid syntax. So, accounting for the
presence or absence
of the & and the ways it can be written (&,
&) I came up with this:
templateData =
templateData.replaceAll("\$entry\.getLink\(\s*\)(&
amp;amp;)?&?",
"#FriendlyPermalink(\$entry)\$entryLink?");
There can still be links that end with
"?page=comments" which loads a
blank page when clicked, so I added another line to strip it
off.
templateData =
templateData.replaceAll("page=comments",
"");
I'm going to try converting all of the statements to regular
expressions. For example, line 692 often won't trigger
since many
themes use whitespace in their "if" statements. (
"if (xxx)" vs
"if(xxx)" ) I'll keep working on them and post
them when they're ready.
I'm hoping to finish with a set of expressions that can
convert all
blojsom 2 templates from the blojsom web site so that they
retain full
functionality.
Kenny
-----Original Message-----
From: blojsom-developers-bounces lists.sourceforge.net
[mailto:blojsom-developers-bounces lists.sourceforge.net] On
Behalf Of
David Czarnecki
Sent: Monday, December 04, 2006 7:43 PM
To: blojsom developers
Subject: Re: [Blojsom-developers] Blojsom 3 upgrade
I might go with an approach to use the #FriendlyPermalink
macro and then
repalce that $entry.getLink() with: #FriendlyPermalink
followed by a
newline
followed by a $entryLink.
On 12/4/06 6:18 PM, "Horan, Kenneth M."
<KHoran intelink.gov> wrote:
> I've been looking into attempting to upgrade the
blojsom 2 themes so
> that I can finally upgrade to blojsom 3. Is there a
blojsom 3
> equivalent to entry().getLink()? I see a lot of themes
using it and
> while some use $permalink instead, most of them never
set that
variable
> so I can't assume it exists. Also, is there any
particular reason
> BlojsomUtils.replace() is user over
String.replaceAll()? Sure regular
> expressions are ugly to read, but when done right
they're much more
> flexible. I've written a few that allow for any amount
of whitespace
> anywhere in the text, but I'm stuck on what to do for
entry().getLink().
>
> Kenny
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief surveys -
and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Blojsom-developers mailing list
Blojsom-developers lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bloj
som-developers
|