English 中文(简体)
TYPO3 - how to set the <base> tag in the header of generated html pages?
原标题:
  • 时间:2009-12-02 10:41:22
  •  标签:
  • typo3

I have inherited ownership of a website running on TYPO3 version 4.2.1. There are two pages that are not rendering correctly, and this seems to be down to a failure to load css and javascript files. Inspecting the page source, I can see that the <base href="blah..." /> tag is missing from the page header.

The question: how on Earth do I set the base url property in TYPO3!?

I have poured over the Typo3 website, edited various "typoscript" files, offered sacrafices to the PHP gods, all to no avail. The generated code still does not include the tag.

Any help appreciated. Please note it is not possible for me to "upgrade to the latest version", and my PHP knowledge is non-existant.

最佳回答

Adding this line to the "Setup" field of your site s main TypoScript template ought to do it:

config.baseURL = < URL here >

The "TSRef" (TypoScript Reference) is a key document for every TYPO3 site administrator -- it s available online here:

http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/current/

I recommend printing out a copy to keep at your desk, you will be referring to it frequently. (They provide it in OpenOffice format as well, to make this easy.)

Section 1.6 ("Setup") describes all the properties you can set via TypoScript s CONFIG object:

http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.3.0/view/1/6/#id2512147

P.S. While I wasn t going to recommend you download the latest version to fix this problem, I will recommend you download the latest version to be sure you haven t missed any security patches.

问题回答

Here is how to set the baseurl within the v4.5 introduction package:

  1. Template > Home > Edit Whole Template Record
  2. Includes (between Options and Recources tab )
  3. Click on the little template icon to the left of ROOT, choose Edit
  4. Under Constants > Config, enter the base domain as shown below (leave out the <>
  5. Rememember to clear all cache and then to Ctrl + F5 to complete refresh the browser

TS:

config {
    # cat=config; type=boolean; label=Admin Panel: Turn on admin panel (mainly for testing purposes only)
    adminPanel = 0

    # cat=config; type=boolean; label=Debugging: Turn on debugging (testing purposes only)
    debug = 0

    # cat=config; type=string; label=Domain name for Base URL: (excluding slashes and protocol like http://)
    domain = < ENTER YOUR DOMAIN HERE >
} 




相关问题
TYPO3 extensions and symlinks

Can I create a symlink to the local extension from aonther project folder? I have a common local-server and i need to implement same extension on all local project-installations. I tried to put the ...

TYPO3: Use TCA.php to build Frontend Forms?

I m searching for a solution, to build a frontend form from the TCA.php of my TYPO3 extension. Is there any way, to select TCA.php values, from my extension Class? I want to build a select-element ...

How to automatically reload TYPO3 calendar from external ics

Hi I m using the calendar base extension (cal) for displaying my calendar in a TYPO3 website. I configured an external calendar and it imports all events correctly. How can I automatically reload the ...

Does a svn frontend for git exist

We are planing to migrate our repositories from svn to git. However there are some people using np_subversion which integrates SVN into the TYPO3-Backend. np_subversion calls the svn client to make ...

wurfl2 integration in TYPO3

everytime i try to install the wurfl2 extension in TYPO3 i get the following error message: Fatal error: require_once() [function.require]: Failed opening required (include_path= .:/usr/local/php/...

TYPO3: getTypoLink_URL alternative (generating url aliases)

Is there an alternative way of getting the URL to a page (by id) apart from using cObj->getTypoLink_URL? I m trying to create URL aliases, so a page can have multiple URLs (for example "/about" ...

热门标签