How to assign H1 to page title?

Discussion in 'CSS' started by cristian, Sep 6, 2010.

  1. #1
    Hi all,

    I have several hundred pages that use the same template. Each page is a one line page title and several paragraphs.

    I'm trying to figure out how I can configure my style.css so that this first line assumes the h1 header, without me having to do the <h1>Page Title</h1> thing on every page.

    All assistance is appreciated!

    - Cris
     
    cristian, Sep 6, 2010 IP
  2. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Not possible through Style.CSS

    CSS to be used for asthetic design of tags which means Tag has to be present in the document. CSS can't push tags dynamically to doucument.
     
    radiant_luv, Sep 6, 2010 IP
  3. cristian

    cristian Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Radiant. I'm actually using a cms (modx) with php to generate my pages. Any ideas how it could be done that way?

    - Cris
     
    cristian, Sep 7, 2010 IP
  4. cubicaaron

    cubicaaron Guest

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you edit your PHP template to include the H1 tags around the proposed title tags, then this will achieve what you're looking for

    In your template file, find something that looks like this, and insert the H1 as shown:

    <html>
    <head>
    <title>Page Title for Title Bar</title>
    </head>
    <body>
    <header>
    This is your header area - for logo and navigation....
    </header>
    <content>
    <h1><?php echo page-title(); ?></h1>
    <p><?php echo page-content(); ?><p>
    </content>
    </html>

    Pretty short, but hopefully you get the gist?

    Post some code and I'll help further
     
    cubicaaron, Sep 8, 2010 IP