1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Creating a page?

Discussion in 'XenForo Questions and Support' started by Michael, Oct 8, 2010.

  1. Michael

    Michael Active Member

    Is there any documentation on how to create a page? Thank you.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Not yet, but here are some quick instructions:

    To create a new page go to http://www.myforum.com/admin.php?nodes/ and click on + Create New Node

    Select Page and configure the fields.
    • Enter a URL (e.g. myfirstpage) – this will be the URL of the page, e.g. http://www.myforum.com/pages/myfirstpage/
    • Enter the title, e.g. Welcome To My Forum
    • Enter a description – this is optional and will appear as muted text below the title (see the screenshots below)
    • Select the Parent Node – this can be the root, a category, forum or another page
    • Set the display order
    • Check the checkbox if you want the page to be visible in the list
    • Enter your markup (HTML/CSS code) in the Template HTML field – see the notes below
    • Select whether you want the published date and number of visits to be displayed in the bottom right hand corner of the page
    • Select whether links to sibling and child nodes are to be displayed within the page
    • Finally you have the option of forcing the page to display in a particular style, no matter what style a member is using.
    If you want page content to look exactly like post content then you must wrap it in this div:
    <div class="messageText ugc baseHtml">
    your content here
    Those 3 CSS classes are responsible for defining the font settings (messageText), styling URL links (ugc) and resetting the html back to “normal” (baseHtml).
    All content must be wrapped in these default classes to enable pages to use the same CSS as forum posts and automatically update with each style

    The image below shows a comparison between a normal post and a page with baseHtml & messageText CSS, baseHtml only, messageText only and no CSS classes.


    As you can see the appearance is quite different in each case, with the last 2 examples actually being restricted to standard text.
    karorogunso, Umit, Veer and 5 others like this.
  3. Michael

    Michael Active Member

    Thanks for that Brogan, thats much more simpler than I expected. Do you have any examples of pages that are made using this method I could look at? :)
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Michael likes this.
  5. Michael

    Michael Active Member

    Thank you, looks very nice. Are we able to use PHP directly within these pages or is it HTML and CSS only?
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, PHP has now been enabled.
    Michael likes this.
  7. Rene

    Rene New Member

    Just as an amendment: You can create pages via your Admin menu really easy.

    Admin-Menu -> Applications -> Create New Node -> Page.

    Michael likes this.
  8. Michael

    Michael Active Member

    Thank you, this is great, cant wait to get started on these :D
  9. wii

    wii Active Member

    Yeah, me too, this might even be enough for a my forum home, instead of a portal system.
  10. Brogan

    Brogan XenForo Moderator Staff Member

    I was just being lazy with my link above which when changed to your domain URL will take you directly to that page :D
    Rene likes this.
  11. Michael

    Michael Active Member

    What do I enter for the callback box(es)? It says theyre optional but when I hit save it wont allow me to do so without entering some data there?
    Mokonzi likes this.
  12. g0rn

    g0rn Well-Known Member

    Redownload XenForo dustribution and reupload the files. It was a bug fixed in first few hours.
    Jethro and Michael like this.
  13. Michael

    Michael Active Member

    Thank you :)
  14. Michael

    Michael Active Member

    Okay I have done that and its allowed me to save but when I use php within the template it isnt working, or at least it appears it isnt.

    All I am using is this:

    <div class="baseHtml messageText">
    Any ideas on how to get it to work? :)
  15. v7web

    v7web Active Member

    Do I just re upload all the xenForo files overwriting existing ones?

  16. g0rn

    g0rn Well-Known Member

    Yes. Actually to get page creation working you have to reupload only library\XenForo\DataWriter\Page.php
    I don't know if there also were another bugfixes so you can reupload all the files to make sure you have latest distribution installed.
  17. Handyman

    Handyman Member

    This won't work for me, the URL Portion won't save. :confused:
  18. Brogan

    Brogan XenForo Moderator Staff Member

    What are you entering in the field and what error are you seeing?
  19. Handyman

    Handyman Member



    URL Portion:
    Please enter a node name using a-z, 0-9, _, and - characters only.
  20. Brogan

    Brogan XenForo Moderator Staff Member

    Just enter the page name in that field, e.g. myfirstpage, test, mypage, team, etc.

    The complete URL is then built up from your domain and installation path.
    CRDeveloper likes this.

Share This Page