Posts by: juergen

Posts: 1480
Post: 11567
Topic: a plugin that compress/optimize html data cached

Assuming your server is Apache:
For better caching append the following code to your .htaccess (and change the values as needed)
mod_expires must be available in order to make it work.
 

<IfModule mod_expires.c>
  ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
  ExpiresDefault                          "access plus 0 seconds"

# Data
  ExpiresByType text/html                 "access plus 0 seconds"
  ExpiresByType text/x-php                "access plus 0 seconds"
  ExpiresByType text/xml                  "access plus 0 seconds"
  ExpiresByType application/xml           "access plus 0 seconds"
  ExpiresByType application/json          "access plus 0 seconds"

# Favicon (cannot be renamed)
  ExpiresByType image/x-icon              "access plus 12 month"

# Media: images, video, audio
  ExpiresByType image/gif                 "access plus 6 month"
  ExpiresByType image/png                 "access plus 6 month"
  ExpiresByType image/jpeg                "access plus 6 month"
  ExpiresByType video/ogg                 "access plus 6 month"
  ExpiresByType audio/ogg                 "access plus 6 month"
  ExpiresByType video/mp4                 "access plus 6 month"
  ExpiresByType video/webm                "access plus 6 month"

# Webfonts
  ExpiresByType application/x-font-ttf    "access plus 12 month"
  ExpiresByType font/opentype             "access plus 12 month"
  ExpiresByType application/x-font-woff   "access plus 12 month"
  ExpiresByType application/x-font-woff2  "access plus 12 month"
  ExpiresByType image/svg+xml             "access plus 12 month"
  ExpiresByType application/vnd.ms-fontobject "access plus 12 month"

# CSS and JavaScript
  ExpiresByType text/css                  "access plus 6 month"
  ExpiresByType application/javascript    "access plus 6 month"

</IfModule>

 

edit: With such sort of aggressive caching, mind to not forget to hard refresh the pages when you make changes to static assets.

 

Edited: 8 months ago
Post: 11563
Topic: Adding script to title

Sure. There are lots of ways to do such things, too many tor a single answer.

So, the questions merely are

Which title?

A) the contents of the <title> HTML tag
B) your Website title as set in Configuration -> Settings -> Title, which will be part of the <title> tag and will be the site branding in most themes by default.
C) a page's internal variable $page->title, which will derive from a page's given name/label and be part of the URL
D) anything else qualifying as 'title', such as a certain heading in the content

Change dynamically …

E) where? (server-side or client-side)
F) based on which source
 

8 months ago
Post: 11560
Topic: Typesetter Website-Search

It's integrated in the core since …um… ages.

Depends on the theme, if you expose it to the visitor, e.g. see Bootswatch Flatly/Sticky Footer template, which has a search form in the main nav.

There is also a 'Search' gadget, you can add via Layout Editor or even use it as 'File Include' section anywhere in the content.

8 months ago
Post: 11558
Topic: Deactivate fonts googleapis.com and gstatic.com

 the path for style.css and variables.scss is

Oh, yes of course. Thanks for the hint.
I'll edit my post...

Edited: 9 months ago
Post: 11556
Topic: Deactivate fonts googleapis.com and gstatic.com

Ok, here we go …
 

1. Open [your Typesetter installation root]/themes/Bootswatch_Scss/Flatly/style.scss and comment out lines 7 and 8

@import 'include/thirdparty/Bootstrap3/scss/_bootstrap.scss';

// Flatly 3.3.5
// Bootswatch
// -----------------------------------------------------

// $web-font-path: "https://fonts.googleapis.com/css?family=Lato:400,700,400italic" !default;
// @import url($web-font-path);


2. If you like to keep the Lato fonts but don't want it to load from a third party, you will need to host it yourself.

Easiest way to do this is to use my web font package plugin

  • Download Lato2015.zip
  • Upload the extracted folder 'Lato2015' from the ZIP archive to your server into the  [your Typesetter installation root]/addons directory
  • Install using Typesetter's Admin Toolbox -> Plugins -> Manage -> Available -> Lato 2.015 LX Fonts

 

3. Since I do font-family definitions slightly different than Goggle, we need to change a Scss theme variable:

Open [your Typesetter installation root]/themes/Bootswatch_Scss/Flatly/variables.scss and change case in line 46 from 'L' to 'l'

//== Typography
//
//## Font, line-height, and color for body text, headings, and more.

$font-family-sans-serif:  "lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
$font-family-serif:       Georgia, "Times New Roman", Times, serif;

 

FYI: This self-hosted font package comes with Lato ver 2.015 as latin-extended character set including all weights and italics. Although Bootswatch Scss Flatly only needs the weights 400 (Regular) and 700 (Bold) dy default, you now have 'Lato Thin', 'Lato Light', 'Lato', 'Lato Bold' and 'Lato Black' available for inline formatting in CK Editor's 'Font' dropdown list. If you want to use e.g. Lato Light in your stylesheet, write font-family: lato-light; font-weight: normal;

If you're just fine without Lato and use the default sans-serif, omit step 2 and in step 3 remove "Lato", from the variable definition.

Edited: 9 months ago
Post: 11554
Topic: Deactivate fonts googleapis.com and gstatic.com

Typesetter (the core system) itself doesn't load any google fonts by default – it's the theme(s) which do. Hence there is no global configuration option for that.

Which theme(s) are you using?

 

 

9 months ago
Post: 11551
Topic: bookmarklet Link

That's a delimiter collision - e.g. use double quotes to delimit strings inside a  single quoted string…

<div style="text-align: left;">
  Dieses <a href="" id="bookmarklet-1">Bookmarklet</a> in die Lesezeichensymbolleiste ziehen und fallen lassen
</div>
<script>
  document.getElementById('bookmarklet-1').href='javascript:location.href="https://webcache.googleusercontent.com/search?q=cache:"+window.location.href';
</script>

BTW: how to paste code inside here in this Forum in this editor?

Use the 'Formatted' option from the 'Format' dropdown list (Normal, Heading 1, Heading 2, … Formatted)

 

9 months ago
Post: 11549
Topic: bookmarklet Link

... for typos?

Especially for MY typos:

<div style="text-align: left;">
  Dieses <a href="" id="#bookmarklet-1">Bookmarklet</a>
  in die Lesezeichensymbolleiste ziehen und fallen lassen
</div>
<script>
  document.getElementById('bookmarklet-1').href='javascript:alert("Oh!")';
</script>

-->

<div style="text-align: left;">
  Dieses <a href="" id="bookmarklet-1">Bookmarklet</a>
  in die Lesezeichensymbolleiste ziehen und fallen lassen
</div> 
<script>
  document.getElementById('bookmarklet-1').href='javascript:alert("Oh!")';
</script>
Edited: 9 months ago
Post: 11548
Topic: bookmarklet Link

does not work

Funnily, it works here. Have you checked the browser console for JS errors (typos, syntax)?
It should actually work.

 

9 months ago
Post: 11546
Topic: bookmarklet Link

Hi Cito, just try

<div style="text-align: left;">Dieses <a href="" id="#bookmarklet-1">Bookmarklet</a> in die Lesezeichensymbolleiste ziehen und fallen lassen</div>
<script>document.getElementById('bookmarklet-1').href='javascript:alert("Oh!")';</script>

 

Assumed reason:
I believe JavaScript code is removed from the href attribute values (and others) so you can not "infect" your site when you copy HTML-formatted content from the Web to your site.
The clipboard may contain various types of content, e.g. Plain text, images, RTF [, etc.], and also HTML.
Fortunately, it is smart enough to omit <script> sections of HTML content when domain boundaries get crossed. However, since attribute values are not filtered automatically, Typesetter (or CKeditor) takes over.

Edited: 9 months ago

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, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register