Topic Closed
mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

I try - similar to Flatly and smart multi  - to add   a javascript  to a settings.php  in a subcolor-directory .

$page->head_js[] = rawurldecode($page->theme_path).'/blue/script2.js'; or

$page->head_js[] = $themeDir.'/blue/script2.js';

But i doesnt appear in the source  as a bug (not found)

P.S. Solved : I have to add the dropdownmenu.php manually with

$path2 = $page->theme_dir . '/blue/settings.php'; include_once($path2); 

settings.php is not atomatic included as in the root - and so i can use any name

rawurldecode doesnt function here under Xampp - but $themeDir

 

Edited: 1 year ago#11779

juergen
1.5K Posts
60.6K Downloads
16 Plugins

 $page->theme_path  already contains the layout (or color) subdirectory. You don't need to append  /blue 

On the other hand,  $page->theme_dir  only points to the (filesystem) theme directory and requires   . '/' . $page->theme_color  to be added to get the layout directory.

Admittedly, this is not exactly logical. And you can't just change it later when themes are already using it.

1 year ago#11784

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

It is really not quite obious... : I need

 $page->head_js[] = rawurldecode($page->theme_path).'/../assets/js/bootstrap.min.js';  in a settings.php as in a multi-template like Bootstrap Flatly

But $page->head_js[] = rawurldecode($page->theme_dir).'/...... gives a double path in Xampp. (popper.min.js is always present during login..)

And $page->head_js[] = $themeDir .'/assets/js/bootstrap.min.js';    ...functions !

Edited: 1 year ago#11785

juergen
1.5K Posts
60.6K Downloads
16 Plugins

Instead of

rawurldecode($page->theme_path).'/../assets/js/bootstrap.min.js'

better use

rawurldecode(dirname($page->theme_path)).'/assets/js/bootstrap.min.js'

But $page->head_js[] = rawurldecode($page->theme_dir) …

$page->theme_dir is a filesystem path. To load a static asset you need the relative path mentioned above.

 

And $page->head_js[] = $themeDir .'/assets/js/bootstrap.min.js';    ...functions !

$themeDir is not a Typesetter variable. Wherever it comes from in your case, others will not be able to use it.

 

Edited: 1 year ago#11786

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

Themedir : I always use in the settings.php

global $page;
$themeDir = dirname($page->theme_path);  evlt. the additional use of  rawurlencode is better ???

$page->head_js[] = $themeDir.'/assets/js/bootstrap45.min.js';  etc.

But direct in the subtemplate.php  a path like $pgreen = $page->theme_dir . '/' . $page->theme_color . '/settings.php'; functions and in the sub - settings.php

$page->head_js[] = $page->theme_path . '/script2.js'; (...try and error..)

SO i am now ready for the smartstrap4 multi - tomorrow.

Edited: 1 year ago#11787

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

Just a notice - im my new smart4m-template you can see the influence of the template on the CMS : Just use the rainbow-template and shift the window to half width and then back . Also the top line with "sections extra content... etc."  turns around and back - the styling is $('ul:nth-child(2)').addClass('animated rotateIn');

A correction to $('ul.dropdown-menu:nth-child(2)').addClass('animated rotateIn'); stops it. I will correct that in the next small update.

Edited: 1 year ago#11788

juergen
1.5K Posts
60.6K Downloads
16 Plugins

$('ul:nth-child(2)').addClass('animated rotateIn');

Where on earth does that come from?
Nobody should ever do anything like this (selecting generic elements without a class, id or context)!

1 year ago#11789

mabu
372 Posts
5.9K Downloads
4 Themes
9 Plugins

Well - as a layman i went to https://www.mediaevent.de/css/css3-selektor-pseudo.html and tried to applicate examples.

Hm...the effect of a rotating top-navigation is still quite interesting - i like it.

But i had other effects . I tried to colorize the bottom-border of the nav ul.nth-child(1) - and all sub-li's of 2nd level had  (at first) also an unwanted underline...(same with li-background)

At https://www.mediaevent.de/css/not.html is also  smething like li:not([class]) { background: gray }  and li:not(.active) { background: gray } --- i know now why so few people still develop  sites  :not(p) {   color: #ff0000; } - what can that be good for

I still miss li:only([class]) { background: gray } ...

Edited: 1 year ago#11790

juergen
1.5K Posts
60.6K Downloads
16 Plugins

If you want that effect only in the main navbar, use

$('#navbarResponsive ul:nth-child(2)').addClass('animated rotateIn');

This will leave all other <ul>s alone.

… :not(p) { color: #ff0000; } - what can that be good for

e.g. .sidebar > *:not(p) { color: #ff0000; }

…would select all direct child elements in .sidebar, which are not paragraphs
Not exactly the best way to get such things done but sometimes we can't get around.

Such rulesets usually take revenge very soon.

I still miss li:only([class]) { background: gray } ...

I don't quite understand. You can select almost anything using more specific attribute selectors (MDN)

Edited: 1 year ago#11791

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Ennetb├╝rgen (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Websi...

Find out more about our Provider Spotlight

Log In

  Register