Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
My site is still in development. Today, I am addressing the Breadcrumbs. For the moment, these appear only in the Galleries all through to the single large image as seen here: https://pideja.ca/galleries/03-tnm/sais … 5-laurier/. Works ok, for now.
I'd like to add two new wrinkles. First, I'd like the breadcrumbs to be throughout the site. Using the php code Daniel suggested in a sticky post (Page-specific PHP code), I changed it to reflect the French language used in the site:
/* Breadcrumbs */
function page_match($gallery) {
if (substr($_SERVER["REQUEST_URI"], 0, strlen($gallery)) == $gallery) {
return 1;
} else {
return 0;
}
}
function ttg_crumb( $page_name ) {
echo '<ul class="breadcrumbs"><li class="fa_pseudo" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/" itemprop="url"><span itemprop="title">Home</span></a></li><li class="fa_pseudo" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">'. $page_name .'</span></li></ul>';
}
function main_top(){
// Add breadcrumbs to non-gallery pages
if (strtolower($this->slug) == 'accueil') {
$this->ttg_crumb('Accueil');
} else if (strtolower($this->slug) == 'contact') {
$this->ttg_crumb('Contact');
} else if (strtolower($this->slug) == 'recherche') {
$this->ttg_crumb('Recherche');
} else if (strtolower($this->slug) == 'xxxx') {
$this->ttg_crumb('Xxxx');
}
}
But, apart from the HOME page displaying in English on the Contact page and twice on...the HOME page, there is no success. Why does the HOME breadcrumb appear twice (as HOME and ACCUEIL) on the Home page?
The other thing I'd like to change is the fact that when I get to the large image, I'd like to have the file name instead of the title displayed in the breadcrumbs. I can change that by omitting to put a title in Lightroom but that just causes me grief for other tasks in Lightroom. Is there a way to use the FILENAME instead of the TITLE for the large image breadcrumb?
Daniel strikes again! Thank tou.
Progressing steadily with the SEARCH page. Got it translated and now refining keywords in Lightroom. Now queries return more precise info.
Thanks to Rod and Daniel.
P.S. Still trying to get that query box more centred...
Thanks, Daniel but I am still looking to edit that pesky text on the search page. Even using the inspector, I have no clue.
Ok, I removed the Quick Search icon then added a search item in the navigation, as per your suggestion. Works well, except that now, there is a text "The search intro" appearing on the search page.
Trouble is I can't find in CSS, in the PHP nor in Backlight where is this text so I can change it. Any hints?
Looking at the pideja.ca folder structure on my ftp client, I notice that the search folder is not in /backlight/search/ but rather /galleries/search/
I am in the process of updating all TITLES in Lightroom Publisher and in Backlight. This should go a long way to return results show names correctly. Also, I started assigning keywords to the images via Lightroom.
Of course, alway put request between "" "". It might take a while but in the end, it should make the search more precise.
Added text to the search page. That's the one that appears with the results. But, alas, I can't find where
to remove that link in the Top Pallet and add a link to the search page in your menu: /backlight/search/
.
Is that in the php or the CSS or directly in Backlight?
On 2020-02-18 18:30:36, about the search function, Daniel Leu wrote:
Works well with full names too. Just put them in quotes: "MICHEL BEAULIEU". If you want matching images, you need to enhance the caption and keywords. There is more about using a search in http://backlight.theturninggate.net/doc … t_s_search
The use of quote (") really helps. As an example, a search for Michel Goulet will return 13 items but if the search is stated "Michel Goulet" will return the correct answer: one production only.
This is for people, but when trying to find productions from a specific theatre, say DUCEPPE for example, only one of thirteen shows are returned.
By the way, this site is sort of a pictural database of theatre productions I have photographed for the last 32 years. My intention is to publish if not all then most of these productions, complete with dates and creative artists names included. So, a search function will come in very handy.
I'd like to know if I can include some text on the search page, to help users.
Also, the initial page where the search box is, displays no masthead, nor top pallet or menu. It's just a box and a loupe symbol. But, once a search is initiated, the appearance of the page conforms to the rest of the site. Why is this?
SUCCESS!
Having re-read carefully the MyFonts instructions and keeping in mind that most mistakes come from syntax or address errors, I corrected the opening statement in my CSS file to read:
@font-face {font-family: 'KabelLTPro-Book';src: url('/backlight/custom/fonts/webfonts/3B0CE6_0_0.eot');src: url('/backlight/custom/fonts/webfonts/3B0CE6_0_0.eot?#iefix') format('embedded-opentype'),url('/backlight/custom/fonts/webfonts/3B0CE6_0_0.woff2') format('woff2'),url('/backlight/custom/fonts/webfonts/3B0CE6_0_0.woff') format('woff'),url('/backlight/custom/fonts/webfonts/3B0CE6_0_0.ttf') format('truetype');}
Just needed to indicate correctly where the Webfont folder was residing.
Now look very good with that slightly strange Kabel font face.
The site in question: pideja.ca
I adjusted the Google Fonts Statement (optional) to
<link rel="stylesheet" type="text/css" href="/backlight/custom/css/MyFontsWebfontsKit.css">
Having put that css file in the CSS folder.
Maybe I'm not putting this statement where it should be...Or, should I put the WebfontKit.CSS within the Fonts folder.
Still no Kabel displaying.
I purchased the Webkit font "Kabel LT Book Pro" and installed the Webkit folder within the FONTS folder. Then, using their instructions (placed a link to their CSS:
<link rel="stylesheet" type="text/css" href="MyFontsWebfontsKit.css">
and your suggested CSS...
body { font-family: KabelLTPro-Book; }
/* custom font */
@font-face {
font-family: 'KabelLTPro-Book';
src: url('/backlight/custom/fonts/KabelLTPro-Book.eot'); /* IE9 Compat Modes */
src: url('/backlight/custom/fonts/KabelLTPro-Book.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/backlight/custom/fonts/KabelLTPro-Book-Regular.woff') format('woff'), /* Modern Browsers */
url('/backlight/custom/fonts/KabelLTPro-Book-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('/backlight/custom/fonts/KabelLTPro-Book-Regular.svg#svgFontName') format('svg'); /* Legacy iOS */
}
I then changed the Prepend Font-family w/ to KabelLTPro-Book
On my machine: still have the Kabel font displayed;
on other stations: type reverted to some kind of Serif font!
I changed the name of the font to Kabel_LT_Pro_Book.ttf The CSS now reads
@font-face {
font-family: 'Kabel_LT_Pro_Book';
src: url('/backlight/custom/fonts/Kabel_LT_Pro_Book.eot'); /* IE9 Compat Modes */
src: url('/backlight/custom/fonts/YourFont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/backlight/custom/fonts/Kabel_LT_Pro_Book-Regular.woff') format('woff'), /* Modern Browsers */
url('/backlight/custom/fonts/Kabel_LT_Pro_Book-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
/*url('/backlight/custom/fonts/Kabel_LT_Pro_Book-Regular.svg#svgFontName') format('svg'); /* Legacy iOS */
}
What about the .woff format? Do I need it?
Should I include this php code:
function head() {
echo ‘
<link rel=”stylesheet” type=”text/css” href=”/backlight/fonts/Kabel_LT_Pro_Book.ttf”>
‘;
}
Also, in Backlight, in the TYPOGRAPHY section, as a Prepend Font-family w/, I have Kabel LT Pro This works on my machine but not elsewhere.
So, my choices are:
-stay with the menu as is;
-go to static vertical navigation (as I originally tried);
-go with a conventional inline horizontal navigation.
Something to think about...
Well, I tried...
Put the Kabel LT Pro folder in Backlight>Custom>Fonts and then I wrote this CSS:
@font-face {
font-family: 'Kabel LT Pro';
src: url('/backlight/custom/fonts/Kabel LT Pro.eot'); /* IE9 Compat Modes */
src: url('/backlight/custom/fonts/Kabel LT Pro.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/backlight/custom/fonts/Kabel LT Pro-Regular.woff') format('woff'), /* Modern Browsers */
url('/backlight/custom/fonts/Kabel LT Pro-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('/backlight/custom/fonts/Kabel LT Pro-Regular.svg#svgFontName') format('svg'); /* Legacy iOS */
}
body {
font-family: 'Kabel LT Pro', Fallback, sans-serif;
I then proceeded to put Kabel LT Pro in the Prepend Font-family w/boxes.
Looks great on my machine...only!
Granted it's a weird font but I think it looks great. But I guess nobody will ever see it.
So, I guess that having a drop-down menu "fall" from that red menu button is out. Too bad.
I guess I'll have to live with it.
I think I asked this a while back but...here goes:
I.m trying to style the side pallet as I use a form of vertical navigation.
Ideally, I would want just a drop-down menu in place of that fly out pallet;
if not, I'd prefer a thinner pallet, 100px instead of the minimum 200 allowed in Backlight. Trying to use CSS:
/* side pallet */
.page__pallet[data-position="T1"], .page__pallet[data-position="T2"] {
width: 100px;
}
witch of course doesn't work.
The fact that the whole page moves, in this case to the left, is a bother I think. If at least the pallet would fly out over the page it would make the page more stable and allow for more stylistic ideas, such as a semi-transparent pallet. Just saying.
Looking for an indication about a font I'm trying to use, I came across this posting.
My problem is that I chose the font Kabel LT Pro Book and it looks good on my display but, of course with all others, it's Helvetica Neue that's seen. I understand the whole websafe font thing but was wondering if there was a way to use this and any other "personal" font?
Testing the search function...a little erratic up to now. Sometimes, entering a full name and surname will be treated as two words and thus, return multiple entries. As an example, entering "Michel Beaulieu" will return shows worked on by "Michel" whoever and "Beaulieu" what's is name!
Also, for some searches, entering the name will return more pertinent results than entering the full name + surname.
Testing ongoing. Also checking how each name is entered on the site.
Thanks a million, Rod.
It's easy for me to get confused in the CSS or php scripts...
Sorry, but it does not work here! I commented the whole section in order to continue working on the site.
As for the AAA, I just wrote that in the inspector in order to test the change.
In the inspector, the text is here:
<input type="text" id="q" name="q" value="" placeholder="Enter search, then press Return...">
As for the CSS link, do you mean this:
/* KABEL font */
function head() {
echo '
<link rel="stylesheet" type="text/css" href="pideja.css">
';
}
I commented it all.
Here it is:
<?php
function user_load($style, $path) {
$g_tsvrl = explode(' ', $style); // Extract gallery type
define ('G_STYLE', strtoupper($g_tsvrl[1])); // and set global for later
$g_path = str_ireplace('\\','/',$path); // change \ to /
$chunks = explode('/',$g_path); // and put into array
define ('G_PATH', strtoupper($chunks[count($chunks)-2])); // gallery folder name is second to last
//define ( 'TTG_SITE', ''); // set new site root for navigation, resources, etc.
}
if (defined('BACKLIGHT_HOOK')) {
require_once(realpath(BACKLIGHT_HOOK).'/modules/module-designer/application/helpers/APHPlugins.php');
}
class PHPlugins extends APHPlugins
{
/* KABEL font */
function head() {
echo '
<link rel="stylesheet" type="text/css" href="pideja.css">
';
}
/* Replace the mobile menu icon with the word "Menu" */
function scripts () {
echo'
<script>$(".page__toggle__buttons label ul").replaceWith("<p>Menu</p>");</script>
';
}
/* Display the logo in pallet_top */
function pallet_top_title () {
echo '
<li class="top-pallet-logo"><a href="/"></a></li>
';
return false;
}
/* search page placeholder text translation */
<script>
jQuery(document).ready(function($){
$(\'#search form\').find("input[type=text]").each(function(ev)
{
if(!$(this).val()) {
$(this).attr("placeholder", "new placeholder text");
}
});
});
</script>
} ?>
I place the faulty code at the very end...
If I use that code, I get:
Unexpected error: syntax error, unexpected '<', expecting function (T_FUNCTION) or const (T_CONST) in pangolin-pideja.php on line 45
If I comment line 45, I get
Unexpected error: syntax error, unexpected 'jQuery' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in pangolin-pideja.php on line 46
In all cases, I can't access the site.
For the moment I settled on placing the search button to the left with the nameplate in the center. Not what I want, ultimately, but it is going to be that for a while, 'til I decide and find out how to design as I want it.
I'm sure the syntax is wrong, but surprisingly, when I write it this way (based on how the inspector describes it):
.fb-search #search {
background-color: #393939;
border-radius: 0;
margin: 0 auto;
max-width: none;
position: relative;
width: 100%;
height: 100%;
}
it does work! The base color of the page went black.
Now, to get that search form translated...
I entered the template name (Search) in the Search Template field.
Being in the ALBUM TEMPLATES there are no settings to change there.
In the PAGE template, the only setting I can see is to switch the Search on or off but in the top palette only.
The main design problem is that being in the top palette, the menu button tends to overlap the search button. I should look into either a specific mobile query for either of these buttons or place the search and menu on opposite sides, with the nameplate either in the header or centred in the top palette.
As for the search box translation, I've looked over the languages section, changed all relevant entries but still no French in the search box.
The SEARCH template is in the ALBUM TEMPLATES in BACKLIGHT. It shows up in the Publisher>Albums section.
But ( I must be having a brain cramp) I can't figure out how to assign the page as the SEARCH template nor how to change the design...
Still in styling the SEARCH, is there a way to place the search button under the top palette? As it is now, it look ok on the large desktop but down on the phone, the search button overlaps the menu button!
If not I'm left with having the menu in the header...