properties files

View: New views
5 Messages — Rating Filter:   Alert me  

properties files

by Scott Hofmann-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
properties files
I have a site that uses the code below to insert a link in the header of a page:

<div class="hdrtxt">#if ( $!content.OfficeLocator2 && $!content.OfficeLocatorText2 ) | <a class="bluebarlink" href="$home/$!content.OfficeLocator2">$!content.OfficeLocatorText2</a>#end #if ( $!content.OfficeLocator3 && $!content.OfficeLocatorText3 ) | <a class="bluebarlink" href="$home/$!content.OfficeLocator3">$!content.OfficeLocatorText3</a>#end </div>

I had a property file for each of the page that looks similar to the below:
<page>
  <property name="title">John Smith, M.D.</property>
  <property name="OfficeLocator">us/cincinnati/pediatrics.html</property>
  <property name="OfficeLocatorText">Cincinnati Pediatrics</property>
  <property name="OfficeLocator2">us/dayton/pediatrics.html</property>
  <property name="OfficeLocatorText2">Dayton Pediatrics</property>
</page>
Recently something has changed causing the first OfficeLocator not to appear. And the second to show as the first. If i only have one OfficeLocator that one does not show now until i add the same data into the OfficeLocator2 property. But if I remove the first Officelocator than the second does not show again.

I'm trying to locate what is different that made this break on me. Could it have anything to do with the way the header code is written?

Any advise would be appreciated.
-- 
- Scott / Hofmann Design

Parent Message unknown Re: properties files

by Ian Miller-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

These properties can be set in your mail _site.xconf at the top level or in the directory where the html files you want to use them on exists.  They will trickle down into the page so that you don't have to set the properties on each page over and over again. 

Your HTML here is looking for OfficeLocator2 and OfficeLocator3 - it's not trying to call OfficeLocator by itself at all.

You can probably do something more like:

#foreach($count in [0..10])
<div class="hdrtxt">
#if ( $!content.OfficeLocator$veloctiycount && $!content.OfficeLocatorText$veloctiycount )
        |  <a class="bluebarlink" href="$home/$content.OfficeLocator$velocitycount">$content.OfficeLocatorText$velocitycount</a>
#end



That should display up to 10 locations, if they exist.  I have tested it, but that's the idea.  Take a peak at :

http://velocity.apache.org/engine/releases/velocity-1.5/vtl-reference-guide.html

and the range operator in particular for the #foreach loop.

Hope this helps,

Ian


On 9/19/07, Scott Hofmann <shofmann@...> wrote:
I have a site that uses the code below to insert a link in the header of a page:

<div class="hdrtxt">#if ( $!content.OfficeLocator2 && $!content.OfficeLocatorText2 ) | <a class="bluebarlink" href="$home/$!content.OfficeLocator2">$!content.OfficeLocatorText2</a>#end #if ( $!content.OfficeLocator3 && $!content.OfficeLocatorText3 ) | <a class="bluebarlink" href="$home/$!content.OfficeLocator3">$!content.OfficeLocatorText3</a>#end </div>

I had a property file for each of the page that looks similar to the below:
<page>
  <property name="title">John Smith, M.D.</property>
  <property name="OfficeLocator">us/cincinnati/pediatrics.html</property>
  <property name="OfficeLocatorText">Cincinnati Pediatrics</property>
  <property name="OfficeLocator2">us/dayton/pediatrics.html</property>
  <property name="OfficeLocatorText2">Dayton Pediatrics</property>
</page>
Recently something has changed causing the first OfficeLocator not to appear. And the second to show as the first. If i only have one OfficeLocator that one does not show now until i add the same data into the OfficeLocator2 property. But if I remove the first Officelocator than the second does not show again.

I'm trying to locate what is different that made this break on me. Could it have anything to do with the way the header code is written?

Any advise would be appreciated.
-- 
- Scott / Hofmann Design


Password protecting a single pages

by Shakeel Ahmad-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
properties files
Hi,
 
I want to password protect a single webpage in a way that when that page is invoked, it takes you to the usual openedit login screen where you can enter admin login and password and then it allows you to view that page.
 
How can I do it?
 
Thanks.
 
Shakeel Ahmad

Re: Password protecting a single pages

by Ian Miller-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If the page was restricted.html you would create a file called restricted.xconf in the same directory and place the following in it:

<page>

<view-requirements>
        <group name="test"/>
</view-requirements>


<path-action name="Admin.allowViewing">   <login-path>/openedit/authentication/logon.html</login-path>
</path-action>

This would prevent anyone in but the users in the group "test" from viewing the page.  They would be redirected.

For more see:

http://www.openedit.org/contentmanagement/View_Permissions.html

On 9/24/07, Shakeel Ahmad <shakeel.ahmad@...> wrote:
Hi,
 
I want to password protect a single webpage in a way that when that page is invoked, it takes you to the usual openedit login screen where you can enter admin login and password and then it allows you to view that page.
 
How can I do it?
 
Thanks.
 
Shakeel Ahmad


Re: Password protecting a single pages

by Shakeel Ahmad-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Thanks. It worked smoothly.
----- Original Message -----
From: ian@...
Sent: Monday, September 24, 2007 5:01 PM
Subject: Re: [openedit-dev] Password protecting a single pages

If the page was restricted.html you would create a file called restricted.xconf in the same directory and place the following in it:

<page>

<view-requirements>
        <group name="test"/>
</view-requirements>


<path-action name="Admin.allowViewing">   <login-path>/openedit/authentication/logon.html</login-path>
</path-action>

This would prevent anyone in but the users in the group "test" from viewing the page.  They would be redirected.

For more see:

http://www.openedit.org/contentmanagement/View_Permissions.html

On 9/24/07, Shakeel Ahmad <shakeel.ahmad@...> wrote:
Hi,
 
I want to password protect a single webpage in a way that when that page is invoked, it takes you to the usual openedit login screen where you can enter admin login and password and then it allows you to view that page.
 
How can I do it?
 
Thanks.
 
Shakeel Ahmad