Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-02-16 22:54:28

blogling
Member
Registered: 2020-01-16
Posts: 12

Remove call for google fonts + creation of css.php

I have not been able to find the source for the call to the googleapis for the fonts:

<!— Google font API —> <link rel=“stylesheet” href=“https://fonts.googleapis.com/css?family=PT+Serif:400,400i,700,700i&amp;subset=latin-ext”>

Same for the source of the creation of “css.php”.

I should remove both. Thanks for your help.

EDIT: moved to the “How?” forum as it’s not about “Core Development”.

Offline

#2 2020-02-16 23:05:59

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,764
Website

Re: Remove call for google fonts + creation of css.php

I’m guessing you’re using Textpattern version 4.7.3. as the google font call has gone in the most recent version.

If so, you’ll find them at the top of the default page template: see here.

You can basically remove those lines if you’re using your own css and just put in a regular HTML link rel="stylesheet" href="…" tag to directly reference your css file.

If you want some extra styles for your textpattern produced content, you can either add that to your original css, or simply add a second link rel="stylesheet" href="…" call to a css file you make as part of your textpattern theme for the extra styles.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2020-02-17 10:02:39

blogling
Member
Registered: 2020-01-16
Posts: 12

Re: Remove call for google fonts + creation of css.php

(Oops, sorry for the wrong forum.)

Thanks, but that is what I did before. Scanned the full package for any occurrence of ‘googleapis’ and removed all references. Then uploaded that file. And still it appears. Plus my link to our own css does not appear. It’s as if there was another reference of default.txt which I cannot touch.

The path I have: …/blog/textpattern/setup/themes/four-point-seven/pages

Is there a copy of that file somewhere else which is the actual one being used? Does it link to an ‘original’ one on Github?

Cheers

Last edited by blogling (2020-02-17 10:26:38)

Offline

#4 2020-02-17 10:38:06

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,764
Website

Re: Remove call for google fonts + creation of css.php

First of all, a couple of things that might be leading to confusion:

  1. The page template should have the file extension .txp (rather than .txt), which may be one reason.
  2. You should be working the …/blog/themes/four-point-seven/pages folder. The one in setup is only used during installation. I only linked to that on GitHub for reference purposes (apologies if that was confusing).

The other reason depends on how you are working. Normally one would work via the Presentation › Pages and make one’s changes there. If, for whatever reason, you prefer to work with files using your own editor, you can do that, but you need to work methodically. There are two ways:

  • Make your changes to the file, upload it to …/blog/themes/your-theme-name/pages (or …/blog/themes/your-theme-name/forms/… for forms) and then in the Presentation › Themes panel import the template files into the database by setting the checkbox next to your theme and choosing “update from disk”. Your changes should now be present.
  • Use the etc_flat plugin during development. For this you have to have your site status set to “Testing” or “Debugging” and you have to be logged in to the admin area. Textpattern then bypasses the database and uses the file version (you see a warning at the bottom of the Presentation › Pages/Forms pane reminding you).
    Note that users that are not logged in (like other people you might want to show) won’t see that. Likewise, setting the site status to “Live” disables the bypass. You first need to import your changes to the database for that to become visible.

Working from files does work well but you need to work diligently. Personally, I always begin by duplicating the theme and giving it an own name and description. I then use the checkbox + “export to disk” option from the dropdown to save that theme to the /themes/your-theme-name/ folder. Then I install and activate etc_flat, and work from the files during the development phase. When I need to show other people (or when I add a new page template or form), I “import from disk” so that the database version is updated for non-logged in users.

Tip: If you have already begun and have a mix of files and database and are not sure which is the most recent, duplicate your theme in the Presentation › Themes panel and export it to disk. That will give you a separate folder with your new name in the /themes folder with the current “database version”, and you can then compare that against your other files without accidentally overwriting anything when importing from disk.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2020-02-17 11:26:33

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,786

Re: Remove call for google fonts + creation of css.php

There’s also this: github.com/petecooper/textpattern-default-theme-no-remote

Default 4.7.3 front side theme, using the fonts but served locally (i.e. no link to Google Fonts).

Offline

#6 2020-02-17 14:11:09

blogling
Member
Registered: 2020-01-16
Posts: 12

Re: Remove call for google fonts + creation of css.php

Thank you friend of the people’s Republic of Cornwall! I shall praise your kindness in front of the next family gathering in Bodmin or Lostwitheal.

Offline

#7 2020-02-17 15:20:13

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,786

Re: Remove call for google fonts + creation of css.php

blogling wrote #321708:

Thank you friend of the people’s Republic of Cornwall! I shall praise your kindness in front of the next family gathering in Bodmin or Lostwitheal.

I like you. You’re swell.

Offline

#8 2020-02-19 14:18:15

blogling
Member
Registered: 2020-01-16
Posts: 12

Re: Remove call for google fonts + creation of css.php

jakob wrote #321702:

First of all, a couple of things that might be leading to confusion:

  1. The page template should have the file extension .txp (rather than .txt), which may be one reason.
  2. You should be working the …/blog/themes/four-point-seven/pages folder. The one in setup is only used during installation. I only linked to that on GitHub for reference purposes (apologies if that was confusing).

Thanks Jakob for your very detailed info.

Now your referenced path …/blog/themes/four-point-seven/pages folder … does not exist here: blog/themes is as far as I get and in there I find an htaccess. (Could there have been a mishap during installation?)

I am quite happy to work with via the Presentation › Pages. It’s very comfortable.

I started modifications and things look ok so far, but where did I modify the blog’s header area? It must have been in Forms -> body_header. That is where I find my code for the custom header of the blog … and in there I see no reference for the call to googleapis … but it still appears on the live page. Also missing in the form body_header is “<title>My site</title>.

I feel a bit like being in the fog saturated Scottish highlands in search of a distillery or in Bodmin Moor at 5 in the morning.

Thanks

Offline

#9 2020-02-19 15:01:01

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,764
Website

Re: Remove call for google fonts + creation of css.php

blogling wrote #321804:

Now your referenced path …/blog/themes/four-point-seven/pages folder … does not exist here: blog/themes is as far as I get and in there I find an htaccess. (Could there have been a mishap during installation?)

No, that’s normal to begin with. You need to first export your theme from the Presentation › Themes pane by ticking the checkbox and choosing “export to disk” from the drop-down. That will create the folder in that directory.

I am quite happy to work with via the Presentation › Pages. It’s very comfortable.

… in which case you don’t have to export to disk, except for safekeeping.

I started modifications and things look ok so far, but where did I modify the blog’s header area? It must have been in Forms -> body_header. That is where I find my code for the custom header of the blog … and in there I see no reference for the call to googleapis … but it still appears on the live page. Also missing in the form body_header is “<title>My site</title>.

The page’s html head section with the googleapis and the title tag is in Presentation › Pages › default at the top because that is part of the <head>…</head> of the HTML code.

The body_header is already inside the body tag (hence the name :-) and has things like the logo, the navigation, etc. which you have mostly replaced with your php includes.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB