Community @ The Turning Gate

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.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2015-05-01 03:29:53

hans3d
Member
Registered: 2012-12-22
Posts: 4

Google Fonts problem

Hi There!

I#m working on a Site update based on CE4 Pages and i want to implement some Google Fonts. but when I add the Google Font Code to the Phplugins.php as described in the documentation my site appears empty, no Navigation no nothing, plain white.
After removing the Goggle Font line from the phplugins.php it works just fine. Phplugins hook seem to work as i get the red background from the custom css, so thats fine to.

Here is the code from the phplugins.php I. trying to use:

// CUSTOM STYLESHEET
// This function implements a custom stylesheet from which users may provide additional page styling or override existing styling set by the plugin
// Edit the custom.css file in /phplugins/css/ to define styles
// Serves as an example of a function being applied globally
function ttg_head_end( $style, $path ) { 
    echo '
    <link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="/phplugins/css/custom.css" />
    ';
} // END

Any Idea whats goin on here?
i'm not a programmer, its ok to copy and paste a few lines of code but when somethings failing I'm pretty much done. So any advise would be very welcome.

thanks a lot,
cheers
hans

Offline

#2 2015-05-01 03:36:54

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Google Fonts problem

You have to escape the single quotes inside the echo '...':

// CUSTOM STYLESHEET
// This function implements a custom stylesheet from which users may provide additional page styling or override existing styling set by the plugin
// Edit the custom.css file in /phplugins/css/ to define styles
// Serves as an example of a function being applied globally
function ttg_head_end( $style, $path ) { 
    echo '
    <link href=\'http://fonts.googleapis.com/css?family=Lobster\' rel=\'stylesheet\' type=\'text/css\'>
    <link rel="stylesheet" href="/phplugins/css/custom.css" />
    ';
} // END

Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#3 2015-05-01 03:57:12

hans3d
Member
Registered: 2012-12-22
Posts: 4

Re: Google Fonts problem

Hurray! Thats it.

took a while till i figured out whats the difference between our code is.

Would be great if this hint would have made it into the documentation though.


Thank you very much for this help, You Just made my day
cheers
hans

Offline

Board footer

Powered by FluxBB