Permlink Replies: 34 - Pages: 3 [ 1 2 3 | Next ] - Last Post: 20 Apr 19, 22:56 Last Post By: RobM
RobM

Posts: 3,815
Registered: 4-Aug-2006
Template Pages
Posted: 18 Aug 14, 03:02
  Click to reply to this thread Reply
Attached is a zip file containing About, Best of, Contact, Contact Print Sheet, iFrame, List Folders, Page of the day, Show new/modifies items and Site map templates.

They should work with most skins that are 'Site aware', also called 'Web page support'. An exception is Polyglot, which is a bit unusual as it supports multiple languages in the generated pages (one set of pages for all languages).

To make them work better (have them put the link to the style sheet in the page 'header') In 'onload.bsh'
add
JCheckBox useTemplateHeader = new JCheckBox ("Used to control template stylesheets", true);
Or, in Settings/Advanced enter 'useTemplateHeader' with a value of true.

In page-header.inc add (don't copy!)
	<ja:if test="<%= useTemplateHeader != void && usePageStyle != void %>">
		<ja:if test="<%= !usePageStyle %>">
			<link href="${templateStyle}" rel=stylesheet type="text/css">
		</ja:if>
	</ja:if>


The templates will generate their own style sheet with a default style, or you can enter your own CSS which will be used instead. The last option is to enter an id (#name) selector (matching one from the skin's CSS) instead, in which case no style sheet is made. You just enter the name, don't include the hash symbol.
Tested with:
Skin				Selector
Base				main
Fully				main	  (care needed with font size)
Galleria			main	  (the skin's properties needs updating to show fullSiteSupport = true)
Turtle				index
 
Crossfader			page	or supplied style
Minimal2for1		        page	or supplied style
Minimal Slideshow	        page 	or supplied style
Notables			supplied style
Polyglot			Not compatible

The About and Contact are based on Laza's templates.
It is an experiment in making templates transportable. If used with skins that do not indicate fullSiteSupport the template settings will not be shown, just a message saying the pages will be made with default settings but navigation to the pages may be missing. It would be better to have them exclude themselves, but I don't know how to do that.

If anyone tries them and has any problems, or not, please consider posting here.

Edited by: RobM on 20-Apr-2019 21:51
Added a 'Best of' page, shows images and videos that are rated 5 star, thumbnails link to the 'normal' slide page
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Template Pages
Posted: 18 Aug 14, 10:51   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Thanks for this contribution! I will look into it and get back.
AndreWolff

Posts: 1,289
Registered: 14-Dec-2007
Re: Template Pages
Posted: 3 Sep 14, 09:44   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
RobM wrote:
They should work with most skins that are 'Site aware', also called 'Web page support'.
What makes a skin 'Site aware'?
Where can I find the recipe to make a skin 'Site aware'?
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Template Pages
Posted: 3 Sep 14, 10:26   in response to: AndreWolff in response to: AndreWolff
  Click to reply to this thread Reply
AndreWolff wrote:
RobM wrote:
They should work with most skins that are 'Site aware', also called 'Web page support'.
What makes a skin 'Site aware'?
Where can I find the recipe to make a skin 'Site aware'?

A skin is "site aware" when it picks up the presence of custom web pages (.htt files under the image directory). Skins need to traverse the AlbumObject tree to pick up these template pages as they aren't automatically added to the iterator element
AndreWolff

Posts: 1,289
Registered: 14-Dec-2007
Re: Template Pages
Posted: 3 Sep 14, 17:28   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Thanks David, but where can I find in detail what to do to make a skin "site aware"?
I am looking for the skin development documents where exactly has been described what to do to make it "Site aware".

What is the best example skin to copy the required code?
RobM

Posts: 3,815
Registered: 4-Aug-2006
Re: Template Pages
Posted: 3 Sep 14, 19:07   in response to: AndreWolff in response to: AndreWolff
  Click to reply to this thread Reply
Read this blog http://jalbum.net/blog/entry/jalbum-as-a-site-maker
Then you could lok at Minimal skin, which is not site aware and my Minimal Slide Show or Minimal 2 for 1 skin. Both of those were based on Minimal, so you just need to look at the skin's folder to see the header/footer/navbar includes and how they are used by index and slide htt files.
RobM

Posts: 3,815
Registered: 4-Aug-2006
Re: Template Pages
Posted: 3 Sep 14, 19:10   in response to: AndreWolff in response to: AndreWolff
  Click to reply to this thread Reply
Also, look at the skins page and filter by "Web page support", that will list all the skins that have been identified as site aware.
AndreWolff

Posts: 1,289
Registered: 14-Dec-2007
Re: Template Pages
Posted: 4 Sep 14, 08:59   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Thanks Rob, I will have investigate it later.

However if "site aware" means a top navigation bar and an about page, I have nothing to do because the Slide Show 4 skin has already the possibility of a top menu and an About page, as you can see here .

But it has not been implemented in the jAlbum way, is that important?
JeffTucker

Posts: 8,039
Registered: 31-Jan-2006
Re: Template Pages
Posted: 4 Sep 14, 09:19   in response to: AndreWolff in response to: AndreWolff
  Click to reply to this thread Reply
But it has not been implemented in the jAlbum way, is that important?

Per Anders, "site aware" (labeled "web page support" in the skin features checkboxes) means that the skin can handle the jAlbum-standard right-click, include page, About.htt (Contact.htt, etc.) mechanism:

http://jalbum.net/forum/thread.jspa?threadID=47600
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Template Pages
Posted: 4 Sep 14, 10:26   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
Peek at the source code for any skin that is site aware, for instance Base.
RobM

Posts: 3,815
Registered: 4-Aug-2006
Re: Template Pages
Posted: 4 Sep 14, 16:37   in response to: AndreWolff in response to: AndreWolff
  Click to reply to this thread Reply
This is to add my comments to jGromit and David's posts.
However if "site aware" means a top navigation bar and an about page
It is more than just that as it allows anyone to design their own template and use it with those skins that are "site aware". There is the problem of styling differences between skins, but if a user is happy with one skin they can make templates just for that skin. These templates were an experiment in making templates easier to use with different skins, that is make it easier for users to have the page design follow that of the skin being used, rather than just the skin they were built for.

But it has not been implemented in the jAlbum way, is that important?
Only if you want to indicate your skins are site aware and support web pages, on the skins web page and within the skin's properties file. If you are happy with how it works you don't have to change it.

At the moment there does not seem to be a big take up on this feature. Maybe a set of design guidelines would help, as well as examples on how to make templates - not difficult as I have made these. One suggestion, for example, is to define the structure of the files a bit more, so that the page-header.inc called up another include for links to CSS and JavaScript files.

As well as the templates posted here I have several others that I use to make content in my website.
AndreWolff

Posts: 1,289
Registered: 14-Dec-2007
Re: Template Pages
Posted: 7 Oct 14, 15:40   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
RobM wrote:
Read this blog http://jalbum.net/blog/entry/jalbum-as-a-site-maker
Then you could lok at Minimal skin, which is not site aware and my Minimal Slide Show
Well Rob, I tried to make the Slide Show 4 skin 'Site aware' by copying code from your Minimal Slide Show.
I added o.a. your file navigation-bar.inc to the root of the Slide Show 4 skin and added at the end of the page-header.inc the code advised in the blog:
<body>
<ja:if test="<%= JAlbumUtilities.hasWebPages(rootFolder) %>">
    <ja:include page="navigation-bar.inc" />
</ja:if>
and copied your about.htt to the templates folder.
Next I added a new page about.htt and tried to generate my test album.

I get a crash with the next text:
Stack trace for jAlbum 12.2.1 using skin Slide Show 4 2.3.4:
 
se.datadosen.tags.ElementException: Evaluation error on line 16:
 
Details:
Sourced file: inline evaluation of: `` 			 			
for (AlbumObject ao : rootFolder.getChildren()) { 				
if (ao.isIncluded( . . . '' : Condition evaluates to void type : at Line: 16 : in file: inline evaluation of: `` 			 			
for (AlbumObject ao : rootFolder.getChildren()) { 				if (ao.isIncluded( . . . '' : defaultShowSettings 
 
	at se.datadosen.jalbum.AlbumBean.doProcessExpression(AlbumBean.java:2012)
	at se.datadosen.jalbum.TemplateParser.eval(TemplateParser.java:681)

This comes from the code in navigation-bar.inc:
<%-- Generate top-level page navigation to pages and subfolders --%>
<div>
		<%
			
			for (AlbumObject ao : rootFolder.getChildren()) {
				if (ao.isIncluded() && !ao.isHidden()) {
					Category cat = ao.getCategory();
					Scope vars = ao.getVars();
					if (cat == Category.webPage || cat == Category.folder) {
						String name = vars.get("label");
						if (currentObject.isWithin(ao))
							out.print("<b>" + vars.get("title") + "  </b>");
						else
							out.print("<a href=\"" + rootPath + "/" + vars.get("closeupPath") + "\">  " + vars.get("title") + "  </a> ");
					}
				}
			}
			if(defaultShowSettings)	out.print("<a href=\"" + rootPath + "/slide_show/index.html\" title=\"shows images in all sub-directories of the root directory\" >Album's slide show</a>");
		%>
</div>
Of course I have no idea what happens here, because I can't find the code of function rootFolder.getChildren().
I can't find this function, neither in one of your other skin files, but also not in the jAlbum skin developpers documentation.

Could you please give a hint to solve this?
RobM

Posts: 3,815
Registered: 4-Aug-2006
Re: Template Pages
Posted: 7 Oct 14, 16:57   in response to: AndreWolff in response to: AndreWolff
  Click to reply to this thread Reply
See http://jalbum.net/help/en/Variables
Right at the bottom is rootFolder.
Using rootFolder with .getChildren() will result in a list of the contents of the rootFolder, I.e. The top level project folders contents.

Try removing the line
if(defaultShowSettings)
AndreWolff

Posts: 1,289
Registered: 14-Dec-2007
Re: Template Pages
Posted: 7 Oct 14, 18:17   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
RobM wrote:
See http://jalbum.net/help/en/Variables
Right at the bottom is rootFolder.
Yes I had seen that already, but .getChildren() was not described. Where can I find the other rootFolder functions?
Try removing the line
if(defaultShowSettings)
Yes that removes the crash and I see an about link at the top of my index page!

Thanks for your help Rob!
RobM

Posts: 3,815
Registered: 4-Aug-2006
Re: Template Pages
Posted: 7 Oct 14, 18:53   in response to: AndreWolff in response to: AndreWolff
  Click to reply to this thread Reply
You can find out more in the API docs, such as http://jalbum.net/api/se/datadosen/jalbum/AlbumObject.html#getChildren--
Some of these methods are standard Java calls, so you could look at any Java reference material to help.
Legend
Forum admins
Helpful Answer
Correct Answer

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