Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Creating a Custom PageID

  1. #1
    Join Date
    Feb 2010
    Posts
    19

    Default Creating a Custom PageID

    I have managed to customize my entire site except one last step. I want to use a custom main.html for listings display (all listings). The documents say:

    .....The PageID=# variable is specified automatically for all page editor created pages, you can create a custom PageID for any other page you wish to have an alternate main template layout for.

    I don't have any problems changing to a custom main.html for a page stored in the database (ie. page2_main.html), and the docs say I can customize Search Results with "searchresults_main.html" but i can't quite grasp how to use a custom main.html with another html file, such as listing_detail_default.html in my case.

    How do I create a custom PageID for listing_detail_default.html and point to it?

    Thanks
    Last edited by appalachian; 02-10-2010 at 06:29 AM. Reason: Wording

  2. #2
    Join Date
    Jul 2005
    Location
    Sao Paulo, BRAZIL
    Posts
    3,763

    Default Re: Creating a Custom PageID

    Please Forum Moderator, move to "Templates - Help/Ideas/Discussion" Forum area.

    Quote Originally Posted by appalachian View Post
    ...I want to use a custom main.html for listings display (all listings)...
    Copy your "main.html" and rename the new file to "searchresults_main.html".
    That's all. There is nothing more to do. Open-Realty will automatically use the new file as your main HTML template file.


    Quote Originally Posted by appalachian View Post
    How do I create a custom PageID for listing_detail_default.html and point to it?
    Copy your "main.html" and rename the new file to lets say "pagelistdetail_main.html". For the listing ID=1, use this link:
    HTML Code:
    index.php?action=listingview&listingID=1&PageID=listdetail
    That's all.

    Eduardo

    [EDITED]
    Or include at your search_result_default.html:
    HTML Code:
    <a href="{link_to_listing}&PageID=listdetail" title="{listing_title}">{listing_title}</a>
    [/EDITED]
    Last edited by ebmarques; 02-10-2010 at 01:52 PM. Reason: Or include at your search_result_default.html

    Open-Realty® DOCs
    We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. (Author Unknown)

  3. #3
    Join Date
    Feb 2010
    Posts
    19

    Default Re: Creating a Custom PageID

    Copy your "main.html" and rename the new file to "searchresults_main.html".
    That's all. There is nothing more to do. Open-Realty will automatically use the new file as your main HTML template file.
    This is what I would like to do, if possible, with listing details.

    "searchresults_main.html" will customize the searchresults pages.
    "page1_main.html" will customize the index/intro page.
    "page(number goes here)_main.html will customize the rest of editor created pages.
    What ?????_main.html will customize all listing detail pages?

    Copy your "main.html" and rename the new file to lets say "pagelistdetail_main.html". For the listing ID=1, use this link:
    index.php?action=listingview&listingID=1&PageID=li stdetail
    That's all.
    "pagelistdetail_main.html" alone does not work. I am using Search Engine Friendly links, so I would like to get away from a link like above, but if I did, where would this link be placed and what would it have to be in order to work with any listing (not just one particular listing)?[/QUOTE}

    Or include at your search_result_default.html:
    <a href="{link_to_listing}&PageID=listdetail" title="{listing_title}">{listing_title}
    I can give this a try If I can figure out where the link in "search_result_default.html" is generated. This template just has tags to pull the information from somewhere else. Which tag is it and where does the data that fills it come from?

    What I would really like is to have a ????_main.html file that works like searchresults_main.html. What is it that allows searchresults_main.html to work without editing anything else? Since there is no html file named searchresults.html, something else is is associating "searchresults" with "search_result_default.html" (or whatever search results template is being used).

    Hopefully this makes sense. Thanks for your help!

    John

  4. #4
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    48
    Posts
    9,796

    Default Re: Creating a Custom PageID

    There is nothing setup in OR to define a main template to be used on the listing detail pages.

    searchresults_main.html works because OR has been coded for that. search_result_default has nothing to do with searchresults_main. The main replaces the main.html template. The search_results_default is the template used for the content.

    Since you're using SEF links this is actually pretty easy to do. Create a page named pagelistdetail_main.html. In the htaccess file add &PageID=listdetail to the listing rewrite rule.

  5. #5
    Join Date
    Feb 2010
    Posts
    19

    Default Re: Creating a Custom PageID

    Maybe I'm not explaining my question correctly....

    If you had just created a custom main.html page to use with displaying all of your listings, and you named it pagelistdetail_main.html. You can't just upload it in your template folder and expect it to work (or it doesn't work in my installation).

    Maybe you could quote the line of code here that would have to be changed to associate your new file with displaying listing detail, and tell me which file the line of code is in. Then show me what the code would read after you have changed it.

    Thanks!

  6. #6
    Join Date
    Feb 2010
    Posts
    19

    Default Re: Creating a Custom PageID

    That was fast. I posted the last question before I saw your last post. I'll look it over and see if I can figure out what to change in .htaccess

    Edit: I don't mind coding OR to use a custom main.html for listing display in the same method as searchresults is, if someone can post the code and location(s). I make a list of modifications I do so if I upgrade later, I can go back and rewrite my mods. Thanks!

  7. #7
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    48
    Posts
    9,796

    Default Re: Creating a Custom PageID

    Quote Originally Posted by appalachian View Post
    That was fast. I posted the last question before I saw your last post. I'll look it over and see if I can figure out what to change in .htaccess

    Edit: I don't mind coding OR to use a custom main.html for listing display in the same method as searchresults is, if someone can post the code and location(s). I make a list of modifications I do so if I upgrade later, I can go back and rewrite my mods. Thanks!
    The code for the main template is in the index.php file. If you want to discuss core file changes you should start a thread in the sandbox area.

  8. #8
    Join Date
    Feb 2010
    Posts
    19

    Default Re: Creating a Custom PageID

    I'm almost there with the .htaccess method. Adding "&PageID=listdetail" will get the right main html but it returns "Perhaps you were look for something else?" in the content area. I think this is because there is nothing there to identify a variable listing ID number.

    Here is the line in .htaccess. What would it have to be if I'm using pagelistdetail_main.html for my custom main.html? Or do I need to write a new rule?

    RewriteRule ^listing-(.*)-([0-9]*).html index.php?action=listingview&listingID=$2 [L]

  9. #9
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    48
    Posts
    9,796

    Default Re: Creating a Custom PageID

    RewriteRule ^listing-(.*)-([0-9]*).html index.php?action=listingview&listingID=$2&PageID=l istdetail [L]

    Remove the space in listdetail. The forum is adding it.

  10. #10
    Join Date
    Feb 2010
    Posts
    19

    Default Re: Creating a Custom PageID

    I ended up writing it into OR. Maybe someone can move this thread to a forum for suggestions for the next release. If this was done, it could be added to the docs in the same place as discussion about customizing the main templates for searchresults_main.html and page#_main.html.

    To follow the general format in OR, I created my custom main template and named it listingview_main.html. Then I added the following lines shown in red in index.php:

    MODERATED - Core file changes can only be discussed in the sandbox forum. If you want to submit a feature requests, use the feature request link form the forum.

    Hopefully nothing was changed during the post to the message board. It is simply copying and pasting the two lines for "searchresults" and substituting "listingview" instead.

    John

Similar Threads

  1. Creating custom Tags
    By timboellis in forum Templates - Help/Ideas/Discussion (CLOSED)
    Replies: 4
    Last Post: 08-22-2009, 07:17 AM
  2. Creating custom permission tags
    By Nuwanda in forum Addon help, ideas and discussion (CLOSED)
    Replies: 0
    Last Post: 08-20-2009, 12:54 AM
  3. Creating a Custom Template Tutorial
    By manamedia in forum Templates - Help/Ideas/Discussion (CLOSED)
    Replies: 20
    Last Post: 06-26-2008, 06:58 AM
  4. Creating a custom contact form
    By bikeman in forum General Help (CLOSED)
    Replies: 2
    Last Post: 12-26-2007, 02:25 PM
  5. Creating custom template - help with images
    By beley in forum Templates - Help/Ideas/Discussion (CLOSED)
    Replies: 3
    Last Post: 12-29-2005, 01:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •