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


Permlink Replies: 16 - Pages: 2 [ 1 2 | Next ] - Last Post: 23 Aug 24, 21:25 Last Post By: John-Simpson
John-Simpson

Posts: 172
Registered: 15-Jan-2008
How to add Data Tables and Accordions to Custom Pages
Posted: 20 Jul 24, 19:22
 
  Click to reply to this thread Reply
I use TIGER skin so this question might be better placed in that forum.

The Text Editor has nearly everything but hasn't got Tables or Accordions.

I have tried using W3 css but as soon as I put the link to the CSS in the Custom Code and Head section of TIGER it alters the alignment of the rest of the album.

 <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> 


Do you have plans to extend the features of the Text Editor or am I attempting something that I shouldn't try to do?

I can put a table in using HTML but I would prefer the look of striped data without borders.

Accordions would also need Custom Script.
RobM

Posts: 3,775
Registered: 4-Aug-2006
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 20 Jul 24, 22:52   in response to: John-Simpson in response to: John-Simpson
 
  Click to reply to this thread Reply
I think you should either stick with the built in HTML editor or, better still, learn to code html and CSS. Linking to such a CSS source will cause all sorts of problems - have a look at the code by loading the link in a browser!
JeffTucker

Posts: 8,181
Registered: 31-Jan-2006
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 20 Jul 24, 23:13   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
Linking to such a CSS source will cause all sorts of problems....

You're not kidding. It's resetting dozens and dozens of common attributes, effectively wiping out Tiger's own CSS. Guaranteed disaster.
RobM

Posts: 3,775
Registered: 4-Aug-2006
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 20 Jul 24, 23:26   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
RobM wrote:
Linking to such a CSS source will cause all sorts of problems....

You're not kidding. It's resetting dozens and dozens of common attributes, effectively wiping out Tiger's own CSS. Guaranteed disaster.

And even adding minimal html//CSS, like https://www.w3schools.com/howto/howto_js_accordion.asp
might not work as expected, because of the skins own code, and if you later change style it might not look good.
John-Simpson

Posts: 172
Registered: 15-Jan-2008
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 21 Jul 24, 00:08   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Thanks Rob and Jeff.

You've confirmed my suspicions but weirdly it only seemed to left align everything on my test album!

Back to the drawing board with some custom css but that may have knock on effects too. If so I'll just use the built in text editor functions.
MarkusD

Posts: 605
Registered: 13-Apr-2006
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 21 Jul 24, 07:32   in response to: John-Simpson in response to: John-Simpson
 
  Click to reply to this thread Reply
Attachment jAlbum-and-W3.7z (358.4 KB)
John-Simpson wrote:
I use TIGER skin so this question might be better placed in that forum.

The Text Editor has nearly everything but hasn't got Tables or Accordions.


Forget the Text Editor, it is bad, fullstop. :-) I use Notepad++ (see attached screenshots)

I have tried using W3 css but as soon as I put the link to the CSS in the Custom Code and Head section of TIGER it alters the alignment of the rest of the album.

W3.css works with Tiger. But you have to do some tricks.

I'm in a hurry right now. The short version:

You have to delete some of the code from the w3.css.

Look at my web site
https://www.markus-drueck.de/norge/

You'll see tables and accordions (they don't use w3.css) and more.

Cheers, Markus
John-Simpson

Posts: 172
Registered: 15-Jan-2008
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 21 Jul 24, 11:39   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Thank you, a truly interesting website. You really do like to travel. I think if you came to UK you would find the roads frustrating, with the potholes, roadworks and congestion, all making any journey into an ordeal.

I'm getting to that age where I want to simplify my website and I have attempted to include everything into jAlbum using add new page instead of bespoke standalone pages that I previously constructed using W3 css. The added advantage of jAlbum pages is that they get included in the Tiger site search.
MarkusD

Posts: 605
Registered: 13-Apr-2006
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 23 Jul 24, 21:06   in response to: John-Simpson in response to: John-Simpson
 
  Click to reply to this thread Reply
John-Simpson wrote:
Thank you, a truly interesting website. You really do like to travel. I think if you came to UK you would find the roads frustrating, with the potholes, roadworks and congestion, all making any journey into an ordeal.

I have been driving in the UK and Scotland (up to the Orkney Islands) in the 90s. I don't remember the road conditions. What is still in my mind, the fantastic single track roads in the Scottish Highlands. I love these roads. :-)

The good thing in Scandinavia (during winter time) is, if you are lucky, the roads are covered with finest snow. Driving on snow is so much fun. :-)

Cheers, Markus
John-Simpson

Posts: 172
Registered: 15-Jan-2008
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 31 Jul 24, 19:11   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
I think you should either stick with the built in HTML editor or, better still, learn to code html and CSS. Linking to such a CSS source will cause all sorts of problems - have a look at the code by loading the link in a browser!

This is the CSS code I've used to display tables in one of my TIGER ALBUMS.

It seems to work okay: Link: MGBreunited/Data

CSS Code:
#jds-table1 {
  font-family: Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}
 
#jds-table1 td, #jds-table1 th {
  border: 0px solid #ddd;
  padding: 5px;
}
 
#jds-table1 tr:nth-child(even){background-color: #336699;}
#jds-table1 tr:nth-child(odd){background-color: #000066;}
 
#jds-table1 tr:hover {background-color: #666666;}
 
#jds-table1 th {
  padding-top: 5px;
  padding-bottom: 5px;
  text-align: left;
  background-color: #990033;
  color: white;
}
 
 
RobM

Posts: 3,775
Registered: 4-Aug-2006
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 31 Jul 24, 20:02   in response to: John-Simpson in response to: John-Simpson
Helpful
  Click to reply to this thread Reply
That’s much cleaner and leaner than importing the whole of the external CSS. I think Tiger uses Flex, Laza could probably show how to replace the tables with fully responsive DIVs and CSS. An example from codepen

Just a gentle push towards becoming a skin developer. ;)
John-Simpson

Posts: 172
Registered: 15-Jan-2008
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 15 Aug 24, 17:01   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
That’s much cleaner and leaner than importing the whole of the external CSS. I think Tiger uses Flex, Laza could probably show how to replace the tables with fully responsive DIVs and CSS. An example from codepen

Just a gentle push towards becoming a skin developer. ;)


The CSS and HTML for ACCORDION BUTTONS

EDITED 21 08 2024 This section has been revised with my own - CSS selectors. to prevent interference with jAlbum code.

1. CSS put into TIGER > SETTINGS > ADVANCED > Custom Code > CSS
 
/* ACCORDION BUTTONS */
 
.jdsaccord {
  background-color: #eee;
  color: #444;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 15px;
  transition: 0.4s;
}
 
.jdsliteblue {
	background-color: #e6e6ff;
	color: #111;
}
 
.jdslitegreen {
	background-color: #e6ffee;
	color: #111;
}
 
.jdsactive, .jdsaccord:hover {
  background-color: #ccc;
}
 
.jdsaccordafter:after {
  content: '\25BC';
  color: #777;
  font-weight: bold;
  float: right;
  margin-left: 5px;
}
 
.jdsactiveafter:after {
  content: "\25B2";
}
 
.jdspanel {
  padding: 0 18px;
  background-color: white;
	color: black;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}
 


2. HTML - typed directly into the comments/description part of a New-Page.htt

WARNING: Under no circumstance press the Edit Text button in the top right hand corner, because it has the power to undo all that you have done!!!!

 
<button class="jdsaccord jdsliteblue jdsaccordafter">Your Title </button>
<div class="jdspanel">
<p>Lots of your text</p>
</div>
 

NOTE: use jdsliteblue or jdslitegreen to change the background colour of the Accordion

3. Script Added at the bottom of the HTML of New-Page.htt

 
<script>
var acc = document.getElementsByClassName("jdsaccord");
var i;
 
for (i = 0; i < acc.length; i++) {
  acc[i].addEventListener("click", function() {
    this.classList.toggle("jdsactiveafter");
    var panel = this.nextElementSibling;
    if (panel.style.maxHeight) {
      panel.style.maxHeight = null;
    } else {
      panel.style.maxHeight = panel.scrollHeight + "px";
    } 
  });
}
</script>
 


Edited by: John-Simpson on 15 Aug 2024, 16:48

Edited by: John-Simpson on 21 Aug 2024, 14:28
John-Simpson

Posts: 172
Registered: 15-Jan-2008
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 15 Aug 24, 17:47   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
BUTTONS ADDED TO CUSTOM PAGES
1. Add some CSS - Tiger - Settings - Advanced - Custom Code - CSS

 /* CUSTOM BUTTON */ 
.custom-button { 
border: none; color: white; 
padding: 10px 16px; 
text-align: center; 
text-decoration: none; 
display: inline-block; font-size: 
16px; margin: 4px 2px; 
cursor: pointer; 
border-radius: 10px; 
}
 
 /* CUSTOM BUTTON - adds choice of button colour*/ 
 
.cust-button-blue {background-color: #008CBA;} /* Blue */ 
.cust-button-green {background-color: #04AA6D;} /* Green */ 
 
/* CUSTOM BUTTON adds hover effect */ 
.custom-button:hover { 
background-color: #666666; 
color: white; 
} 


2. Add the Button HTML to your New-Page.htt (Do not use the inbuilt Text Editor)

 <button class="custom-button cust-button-blue">Button Text</button> 


Edited by: John-Simpson on 23 Aug 2024, 18:19
John-Simpson

Posts: 172
Registered: 15-Jan-2008
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 15 Aug 24, 18:43   in response to: John-Simpson in response to: John-Simpson
 
  Click to reply to this thread Reply
USING A BUTTON TO NAVIGATE TO ANOTHER PLACE ON YOUR PAGE

This can be done by using your own CSS and HTML.

CSS FOR BUTTON (goes in TIGER >Advanced >Custom Code >CSS)
.custom-button {
  border: none;
  color: white;
  padding: 10px 16px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 10px;
}
 
/* CUSTOM BUTTON - adds choice of button colour*/
.cust-button-blue {background-color: #008CBA;} /* Blue */
.cust-button-green {background-color: #04AA6D;} /* Green */
 
/* CUSTOM BUTTON adds hover effect */
.custom-button:hover {
  background-color: #666666;
  color: white;
}

HTML for Button - added to your Page in jAlbum
<tr id="mac"><th colspan="4" style="text-align:left">
 <button class="custom-button cust-button-blue" onclick="document.location='#sheila' ">
Click to go to location called Sheila ↓</button>

Clicking the button will take you to the location with the named id="sheila" for example, which is elsewhere on your website.
<tr id="sheila"><th colspan="4" style="text-align:left"> Some Text </tr> 

The id name has to be unique for that page of HTML and mustn't start with a number. It could be what you want to call it - id="top" or id="bottom" or even to another lpage on your website by adding a relative link.

The id can be attached to other elements too:

<p id="sheila"> Text about Sheila.  </p>


Edited by: John-Simpson on 23 Aug 2024, 20:18 Substantially revised to show how a button is added.
RobM

Posts: 3,775
Registered: 4-Aug-2006
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 15 Aug 24, 20:57   in response to: John-Simpson in response to: John-Simpson
 
  Click to reply to this thread Reply
The accordion works well. Not sure about your 'NOTE: a) the #sheila is just a Tagged link to an element id location on the same page. id="sheila"'. As in your code examples there is no element with an id of sheila.
John-Simpson

Posts: 172
Registered: 15-Jan-2008
Re: How to add Data Tables and Accordions to Custom Pages
Posted: 15 Aug 24, 22:15   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Sheila is just a named tag - not sure of their proper name - maybe anchor links. See example: Link: sheila

 
<table>
<tr id="sheila">
<th colspan="4" style="text-align:left">
<button class="custom-button cust-button-blue">1936-1941 &uarr;</button> 
<button class="custom-button cust-button-blue">1957-1961 &darr;</button> 
<button class="custom-button cust-button-blue">1966-1968 &darr;</button>
</th>
</tr>
<tr>
<th colspan="4">
1943 - 1949 - TEACHERS AND STAFF (from Sheila Cornell)</th>
</tr>
</table>


NOTE:
a) the #sheila is just a Tagged link to an element id location on the same page with id="sheila" .
b) Directional arrows can be added using Unicode characters.
 DOWN & #8595;  ↓  and UP & #8593; ↑ 

(remove the space between & and # to display an arrow)

Edited by: John-Simpson on 23 Aug 2024, 18:21
Legend
Forum admins
Helpful Answer
Correct Answer

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