Home » jAlbum forums » Skins, Plugins, and Tools » Base

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


Permlink Replies: 11 - Pages: 1 - Last Post: 24-Jan-2012 16:44 Last Post By: John-Simpson
John-Simpson

Posts: 207
Registered: 01/15/08
BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 13:07
 
  Click to reply to this thread Reply
Before I change over to the Base skin I'm trying to get similar functionality to my old skin. My web sites all consist of a Home page constructed in Dreamweaver which links to several photo albums each generated in JAlbum. (I do it that way because each album within a single domain name has different photo sizes etc.)

My question is how does the Link from top level page input box work? It's in Base Skin settings labeled Link from top level page.

Is it purely to provide the absolute or relative path of the Home page on the Up Arrow or will it provide an up-link on the breadcrumb path? I think it only does the former.

On my old skin I had a text file called: linkHome.inc placed in the image directory. The file would have the link home HTTP such as:
<a href="http://www.mgbreunited.org.uk/">Home</a> | 


The linkHome.inc is placed before the navigation path in index.htt and slide.htt. and gives the HOME link on the generated HTML pages.

I was hoping that I could do away with the linkHome.inc file and input it directly into the aforesaid input box.

Also, I don't know where the inputs on the settings page are stored? I would have thought somewhere in the albums image directory as they are specific to a particular photo album, but I can't find them.
jGromit

Posts: 25,325
Registered: 01/31/06
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 13:17   in response to: John-Simpson in response to: John-Simpson
Helpful
  Click to reply to this thread Reply
Attachment Dashboard.jaext (12,9 KB)
John-Simpson wrote:
Also, I don't know where the inputs on the settings page are stored? I would have thought somewhere in the albums image directory as they are specific to a particular photo album, but I can't find them.

They're stored in the project file (the .jap file), which is actually just a text file that you can open in a text editor, and take a look at. The entries are unsorted, which makes it tough to find things when you're dealing with a skin that has a lot of settings. TomCee produced a little extension that helps. Save the attached file to your PC, then just double-click on it to install it into jAlbum. Then, when you've got a project open, you can choose Tools, Dashboard (or just hit ALT-D) to get a popup window with various tabs that show you the contents of the project file, sorted and categorized.
John-Simpson

Posts: 207
Registered: 01/15/08
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 14:05   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
EarlyOut wrote:
They're stored in the project file (the .jap file), which is actually just a text file that you can open in a text editor, and take a look at. The entries are unsorted, which makes it tough to find things when you're dealing with a skin that has a lot of settings. TomCee produced a little extension that helps. Save the attached file to your PC, then just double-click on it to install it into jAlbum. Then, when you've got a project open, you can choose Tools, Dashboard (or just hit ALT-D) to get a popup window with various tabs that show you the contents of the project file, sorted and categorized.

I didn't know the jap file opened with just a text editor! The Dashboard certainly sorts out the entries and must be a boon to skin designers. I've learnt something new again!

I've always thought that using .inc files to add headers and footers extra HTML anywhere was a good idea but not user friendly having to remember to edit these files for new albums. Now I can see no reason why they cannot be designed in the skin using onload.bsh to create input boxes for headers, footers etc. I'm sure lots of skins do this already.

Thanks for your help.

Edited by: John-Simpson on 23-Jan-2012 13:06
jGromit

Posts: 25,325
Registered: 01/31/06
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 14:25   in response to: John-Simpson in response to: John-Simpson
Helpful
  Click to reply to this thread Reply
I've been tempted to create boxes to allow users to enter the header and footer material directly in the user interface, but when I've seen how some users make use of include files, I've thought better of the idea. Someone who's creating a site header, complete with logo images and navigation menus, doesn't want to wrestle with trying to edit all that material in a little input box that doesn't have any of the capabilities of a real code editor.

Letting users do it either way, via an input box or via an include file, sounds attractive until you start thinking about what the skin should do if both exist. One before the other? One in preference to the other? It becomes a very deep rabbit hole. ;)
jGromit

Posts: 25,325
Registered: 01/31/06
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 15:55   in response to: John-Simpson in response to: John-Simpson
 
  Click to reply to this thread Reply
John-Simpson wrote:
Is it purely to provide the absolute or relative path of the Home page on the Up Arrow ....?

Correct. It's used only for the up-arrow on the top-level index page.

Welcome to the wonderful world of trying to assemble a breadcrumb trail. It's a thrill a minute, I can guarantee!

First, you'll probably want to create a new variable, perhaps called uplinkLabel (to go along with the existing uplinkUrl), along with an input box for it, a texts.properties label for it, etc., etc., just like the other goodies you've added to the UI, so that you can enter the text you want to appear, rather than hard-coding something like "Home" or "Main Index."

Now comes the fun part. If that uplinkUrl were always an absolute URL, you could get away with a simple fiddle to index.htt (and a similar one in slide.htt), something like:
Existing line:
 
<h1><ja:if exists="indexBreadcrumbPath"><small>${indexBreadcrumbPath}${pathSep}</small></ja:if><%= title.replaceAll("_", " ") %></h1>
 
New version:
 
<h1><ja:if test="<%=indexShowBreadcrumbPath && !uplinkUrl.equals("")%>"><small><a href="${uplinkUrl}">${uplinkLabel}</a>${pathSep}</small></ja:if>
<ja:if exists="indexBreadcrumbPath"> (etc.)
But if uplinkUrl is a relative address, you've got a problem. From the top level index, the path to, say myhomepage.html, is ../myhomepage.html. But from one folder level down, the path is ../../myhomepage.html. From the next folder down, ../../../myhomepage.html.

So, you end up needing to write a routine that examines uplinkUrl to figure out whether it's an absolute or relative address (I generally assume that anything that doesn't start with http:// is a relative address), and then, if it's a relative address, prepending the requisite number of ../'s to it, depending upon what level you're at.
John-Simpson

Posts: 207
Registered: 01/15/08
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 16:06   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
EarlyOut wrote:
I've been tempted to create boxes to allow users to enter the header and footer material directly in the user interface, but when I've seen how some users make use of include files, I've thought better of the idea. Someone who's creating a site header, complete with logo images and navigation menus, doesn't want to wrestle with trying to edit all that material in a little input box that doesn't have any of the capabilities of a real code editor.

Letting users do it either way, via an input box or via an include file, sounds attractive until you start thinking about what the skin should do if both exist. One before the other? One in preference to the other? It becomes a very deep rabbit hole. ;)

I see what you mean - neither way is ideal. I think here it would be important to give newcomers precise instructions what to do. This is often somewhat lacking in the inputs for a skin's settings. Mouse-over hints help, but a more positive approach would be a question mark help icon with pop up help text. This could be used against input boxes that require some explanation and give examples of text or HTML that needs entering in a particular field.

Clearly, I didn't know what was required to be inputted in the BASE skins Link from top level page input box!!!!

I don't know whether a hep button can be done easily in onload.bsh?

jGromit

Posts: 25,325
Registered: 01/31/06
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 16:22   in response to: John-Simpson in response to: John-Simpson
 
  Click to reply to this thread Reply
Providing help popups is a beast. It ends up taking more time than doing the actual coding. In my own skins, I just stick a link on the "About" tab to an online users manual. Laza puts a "Help" link on the UI, one that pulls up a manual that's bundled with the skin.

You can do a lot with mouseover tooltips. Do some poking around in Classic Aligned 2 for examples. Its onload.bsh isn't compiled, so you can explore, and see how it's done. The file is huge - search for setToolTipText.
John-Simpson

Posts: 207
Registered: 01/15/08
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 17:25   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
EarlyOut wrote:
Now comes the fun part. If that uplinkUrl were always an absolute URL, you could get away with a simple fiddle to index.htt (and a similar one in slide.htt), something like ... But if uplinkUrl is a relative address, you've got a problem. From the top level index, the path to, say myhomepage.html, is ../myhomepage.html. But from one folder level down, the path is ../../myhomepage.html. From the next folder down, ../../../myhomepage.html.

I shall stick to absolute file path. It is what I do now with the .inc file. I remember looking at this years ago and getting a relative path to know where it is, was mind blowingly difficult. I believe relative links are supposed to be best on web site for loading speed reasons, but the simple solution is absolute - and it works!
John-Simpson

Posts: 207
Registered: 01/15/08
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 21:06   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
EarlyOut wrote:
Existing line:
<div class="jive-quote"> 
<h1><ja:if exists="indexBreadcrumbPath"><small>${indexBreadcrumbPath}${pathSep}</small></ja:if><%= title.replaceAll("_", " ") %></h1>
 
New version:
 
<h1><ja:if test="<%=indexShowBreadcrumbPath && !uplinkUrl.equals("")%>"><small><a href="${uplinkUrl}">${uplinkLabel}</a>${pathSep}</small></ja:if>
<ja:if exists="indexBreadcrumbPath"> (etc.)

I've put the above code into my index.htt and slide.htt and it works very well - thank you very much. I shall now go and look at how to put tool tips into onload.bsh skin settings.

PS To anyone copying this code: Please note on the second line of the new code an
<h1> 
tag has been removed from the beginning of the line. Otherwise it sends all your text into super-size. Yes - I found out the hard way!
jGromit

Posts: 25,325
Registered: 01/31/06
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 21:39   in response to: John-Simpson in response to: John-Simpson
 
  Click to reply to this thread Reply
Just note that in slide.htt, the variable you're checking against should be slideShowBreadcrumbPath, rather than indexShowBreadcrumbPath.
jGromit

Posts: 25,325
Registered: 01/31/06
Re: BASE SKIN - Uplink to HOME page
Posted: 23-Jan-2012 23:51   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
If you want to adapt it so that it can handle a relative path for the uplinkUrl, you could use this:
<%
	uplinkPath = (level == 0 || uplinkUrl.startsWith("http://")) ? uplinkUrl : rootPath + "/" + uplinkUrl;
%>
<h1><ja:if test="<%=indexShowBreadcrumbPath && !uplinkUrl.equals("")%>"><small><a href="${uplinkPath}">The Text</a>${pathSep}</small></ja:if>
Note that the href now refers to uplinkPath rather than uplinkUrl. The jAlbum rootPath variable takes care of keeping track of how far down the folder structure you are.

In slide.htt, you can simplify the test a bit:
<%
	uplinkPath = (uplinkUrl.startsWith("http://")) ? uplinkUrl : rootPath + "/" + uplinkUrl;
%>
<h1><ja:if test="<%=slideShowBreadcrumbPath && !uplinkUrl.equals("")%>"><small><a href="${uplinkPath}">The Text</a>${pathSep}</small></ja:if>


Edited by: EarlyOut, for tighter code
John-Simpson

Posts: 207
Registered: 01/15/08
Re: BASE SKIN - Uplink to HOME page
Posted: 24-Jan-2012 16:44   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
EarlyOut wrote:
Providing help popups is a beast. It ends up taking more time than doing the actual coding. In my own skins, I just stick a link on the "About" tab to an online users manual. Laza puts a "Help" link on the UI, one that pulls up a manual that's bundled with the skin.

You can do a lot with mouseover tooltips. Do some poking around in Classic Aligned 2 for examples. Its onload.bsh isn't compiled, so you can explore, and see how it's done. The file is huge - search for setToolTipText.


I've looked at Classic Aligned 2 onload.bsh and there is a lot of it. (Too much for me to grasp!!). I've had partial sucess in applying it to my version of BASE skin. I get a tool tip on the input box but not on the text!!

I'll start this off as a new topic so that you get the points :)

http://jalbum.net/forum/thread.jspa?threadID=40806
Legend
Forum admins
Helpful Answer
Correct Answer

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