This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Pages: 1 - Last Post: 29-Oct-2017 22:13 Last Post By: jGromit Threads: [ Previous | Next ]
jGromit

Posts: 33,185
Registered: 31-Jan-2006
"Include once" per directory
Posted: 19-May-2015 14:42
 
  Click to reply to this thread Reply
The <ja:include> tag has a once attribute that causes the page to be included only once for the project. Useful, but for things like that, it's easier just to plant the code in init.bsh.

What's needed, instead, would be a tag that says, "include this page only once per directory." In other words, include this page when creating index.html, but don't call it again for index2.html, index3.html, and so on. At the next level down, however, it needs to be called for each folder, but again, only once for each.
<ja:include onceperdir page="includes/dirlevel.inc" />
Currently, I do this by having dirlevel.inc start with a check to avoid unnecessary repetition:
<%
if(indexNum == void || indexNum == 1) {
	do some stuff;
}
%>
jGromit

Posts: 33,185
Registered: 31-Jan-2006
Re: "Include once" per directory
Posted: 29-Oct-2017 22:13   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jAlbum now recognizes a predir.bsh or predir.js file, which is executed once per directory. That takes care of this feature request (and a virtually identical one from six years ago that I'd forgotten about completely).
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums