Displaying page title : Various methods

Getting page title for a specific page (using uid)

METHOD 1:

temp.pTitle = HMENU
temp.pTitle {
special = list
special.value = {$my_page_uid}
1 = TMENU
1 {
NO {
doNotLinkIt = 1
}
}
}

METHOD 2: (The localization may not work fine in the below method)

lib.pagetitle = RECORDS
lib.pagetitle {
source.data = page:uid
tables = pages
conf.pages = TEXT
conf.pages.field = nav_title
}

Getting Current Page Title:

lib.pagetitle = TEXT
lib.pagetitle.field=title

Page title of parent page:

lib.pagetitle = TEXT
lib.pagetitle.data = leveltitle:-2
OR
lib.pagetitle = TEXT
lib.pagetitle.data = leveltitle:-3

Inserting page title within a HMENU

temp_pagetitle = TEXT
temp_pagetitle.data = leveltitle:-2

leftMenu = HMENU
leftMenu.stdWrap.preCObject < temp.leftmenu_pagetitle
leftMenu.1 = TMENU
leftMenu.1.wrap = <ul class=”cw_leftmenu”>|</ul>
leftMenu.1.NO.wrapItemAndSub = <li>|</li>
leftMenu.1.ACT = 1
leftMenu.1.ACT.wrapItemAndSub = <li>|</li>
leftMenu.1.ACT.allWrap = <span class=”active_menu”>|</span>
leftMenu.1.CUR = 1
leftMenu.1.CUR.allWrap = <span class=”cur_menu”>|</span>
leftMenu.2 < .1
leftMenu.3 < .2

How to find and change TYPO3 settings.

This is a small reference to give an idea on how to find a TYPO3 setting that can be changed, and how to change it.

Easy:

  1. go to BE
  2. Click the Configuration module in left menu bar
  3. Now use the drop down at the top, and select TYPO3_CONF_VARS.
  4. Search for what you need
  5. Click on the needed title
  6. Now you get a array like this:
    $TYPO3_CONF_VARS[‘EXTCONF’][‘cachecleaner’][‘tables’][‘cache_pages’][‘expireField’] = ‘expires’;
  7. Change this in your extension (in a PHP file) and include this file in ext_localconf.php
    OR Directly write inside ext_localconf.php (well this may not be very clean)

NOTE: The CONFIGURATION Module is like a TREE browser which lists all kind of available configurations available in TYPO3.
So we have endless chance to change and customize almost anything here!

NOTE2: The TYPO3 Configuration Module is also a place where you can see the current configuration that is in use.
This can be used for wide range of debugging, such as:

  1. To analyze if a HOOK/XCLASS has been declared or not
  2. To see if the configuration we specified has been really recognized by TYPO3

ENJOY!

How to enable Admin Panel in TYPO3

In order to make sure that the admin panel is visible when you are in backend, make sure that the following criteria are met:

1. Make sure you are logged in to the BE of same domain.

In a multi-domain setup, if you are logged in www.domain-a.com, and you try to view www.domain-b, then don’t expect the preview / admin panel to work.
This simply does not work!

2. user and/or group setup:

admPanel=1
admPanel {
enable.edit = 1
enable.edit.hide=1
enable.preview = 1
enable.cache = 0
enable.info = 1
module.edit.forceDisplayFieldIcons = 1
module.edit.forceDisplayIcons = 1
module.edit.forceNoPopup = 0
hide = 0
}

3. root template setup:

config.admPanel=1

How to enable jQuery with powermail OR How to remove mootools or prototype from powermail, and use jQuery validation

In some cases we may wish to retain one single library throughout our site, so powermail does not have issues if we choose mootools or prototype.
If we prefer jQuery, then we have some issues at present, as powermail does not yet allow us to use jQuery built in.
The future version however seem to include this feature, and we are waiting, untill then this might prove useful.

  • Step 1: Set nothing for the libraryToUse contstant (of course in constants section)
    plugin.powermail.libraryToUse =
  • Step 2: Set up a different template path for the formWrap — This is important, will explain later in Step3!
    To do this I will copy the formwrap.html located in typo3conf/ext/powermail/templates/tmpl_formwrap.html to fileadmin/templates and set following constant.
    plugin.powermail.template.formWrap = fileadmin/templates/tmpl_formwrap.html

    NOTE: You may change template even in setup section, check manual or ext_typoscript_setup.txt for details.

  • Step 3: Remove the validation script from formwrap.html that we copied just now.
    If you look at the tempalte file, you can see folloing JavaScript:

    <script type=”text/javascript”>
    function formCallback(result, form) {
    window.status = “valiation callback for form ‘” + form.id + “‘: result = ” + result;
    }
    var valid = new Validation(‘###POWERMAIL_NAME###’, {immediate : true, onFormValidate : formCallback});
    </script>

    Remove the above completely including <script> tags.

  • Step 4: Remove automatic inclusion of JS files using TypoScript. (IMPORTANT: This must appear in the setup section)
    page.includeJS.file31311 >
    page.headerData.31310 >

There you go, by now you should have disabled the output of all java scripts and inclusion of JS Libraries like mootools or prototype.
Now you are free to use any library you need.

NOTE: By now the default validation methods available in powermail are also disabled. Well we can easily use the jquery form validation!