Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using Template Params with links

New Here ,
Dec 13, 2006 Dec 13, 2006
Hi all, I was wondering how I could use a template parameters to change all links' prefix. For example all pages on my site will use relative paths to pages within the site. A few pages in the site are secure and therefore get directed to a "secure" server so the URL becomes different. Those pages cannot use relative URL's to get back to the 'normal', unsecured, site so they must use complete path " http://www.whatever.com/" in front of the links. I'm thinking I can make two template params like so:

<!-- TemplateParam name="rootSite" type="text" value=" http://www.whatever.com" -->
<!-- TemplateParam name="pageSecure" type="boolean" value="true" -->

but I some how need it to search through the document for all links and put the 'rootSite' inserted before whats already there. Can this be done??? If so, how?

Thanks in advance!

Buddy
TOPICS
Server side applications
417
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 13, 2006 Dec 13, 2006
I would make this -

<!-- TemplateParam name="rootSite" type="text"
value=" http://www.whatever.com"

be this -

<!-- TemplateParam name="rootSite" type="text"
value=" http://www.whatever.com/"


Find (in current document) -

<a href="

Replace with -

<a href="@@(rootSite)@@

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW ...
Translate
LEGEND ,
Dec 13, 2006 Dec 13, 2006
I would make this -

<!-- TemplateParam name="rootSite" type="text"
value=" http://www.whatever.com"

be this -

<!-- TemplateParam name="rootSite" type="text"
value=" http://www.whatever.com/"


Find (in current document) -

<a href="

Replace with -

<a href="@@(rootSite)@@

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"buddyq" <webforumsuser@macromedia.com> wrote in message
news:elp9s5$7k1$1@forums.macromedia.com...
> Hi all, I was wondering how I could use a template parameters to change
> all
> links' prefix. For example all pages on my site will use relative paths to
> pages within the site. A few pages in the site are secure and therefore
> get
> directed to a "secure" server so the URL becomes different. Those pages
> cannot
> use relative URL's to get back to the 'normal', unsecured, site so they
> must
> use complete path " http://www.whatever.com/" in front of the links. I'm
> thinking I can make two template params like so:
>
> <!-- TemplateParam name="rootSite" type="text"
> value=" http://www.whatever.com"
> -->
> <!-- TemplateParam name="pageSecure" type="boolean" value="true" -->
>
> but I some how need it to search through the document for all links and
> put
> the 'rootSite' inserted before whats already there. Can this be done??? If
> so,
> how?
>
> Thanks in advance!
>
> Buddy
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 13, 2006 Dec 13, 2006
I could do that but i'm looking for a solution that would automatically put that to use only IF the page is supposed to be 'secured'. I am trying to avoid having to do this on every link of the page to save time and be a little more dynamic should people in the future change, delete, or add links.

Buddy
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 13, 2006 Dec 13, 2006
You could add a <base> tag to the head of the pages involved, which, now
that I think about it might be the very best way.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"buddyq" <webforumsuser@macromedia.com> wrote in message
news:elpc7b$ai1$1@forums.macromedia.com...
>I could do that but i'm looking for a solution that would automatically put
> that to use only IF the page is supposed to be 'secured'. I am trying to
> avoid
> having to do this on every link of the page to save time and be a little
> more
> dynamic should people in the future change, delete, or add links.
>
> Buddy
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 13, 2006 Dec 13, 2006
DOH! exactly! hahaha thanks. It's always the basics you forget when trying to use something else for the same task. Thanks.

For the sake of it all though: I am trying to do it your original way and I get an error when saving the template. It says "access to undefined template parameter "siteRoot". Any ideas why?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 13, 2006 Dec 13, 2006
Got it working with the template expression. I could not use the BASE tag after all since it changes the base for all images as well and nothing showed up on the test server. Thanks!


Buddy
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 13, 2006 Dec 13, 2006
LATEST
If the template parameter is defined on that page with the name "siteRoot",
then the reference to it will work.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"buddyq" <webforumsuser@macromedia.com> wrote in message
news:elpegh$dbv$1@forums.macromedia.com...
> DOH! exactly! hahaha thanks. It's always the basics you forget when trying
> to
> use something else for the same task. Thanks.
>
> For the sake of it all though: I am trying to do it your original way and
> I
> get an error when saving the template. It says "access to undefined
> template
> parameter "siteRoot". Any ideas why?
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines