Announcement

Collapse
No announcement yet.

Page Extension?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Page Extension?

    Any idea if you can change the default extension of the pages from html to php?

    With our new design we're planning on having a list of brands down the left side of the page (a pretty big list) but rather than having to go through an update changing every page when we add a new brand I'd rather use a PHP include and just change the one file.

    Any idea if this is possible?

    Thanks.

    #2
    This was mentioned some time ago - you may be able to search and find the thread. I think it was one for the v7 wish list but may be wrong.

    Comment


      #3
      If you can't change the extension and this list isn't needed for search engines then you could always include them as follows:
      Add this bit of code to the bottom of actiniccore.js (it's borrowed from the V8 version).
      Code:
      /***********************************************************************
      *
      * HtmlInclude		-	Parses the page for <a href> tags and if any found 
      *							with rel="fragment" attribute then create an XMLHTTP
      *							request to download the referenced file and insert the
      *							file content in place of the referring tag.
      *							In case of error just leave it as is.
      *
      *	NOTE: this function is automatically attached to the onload event handler
      *	therefore this processing is done on all pages where this js file is included.
      *
      * Returns:				nothing
      *
      * Author:				Zoltan Magyar
      *
      ************************************************************************/
      
      function HtmlInclude() 
      	{ 
      	var req;
      	//
      	// Check browser type
      	//
      	if (typeof(XMLHttpRequest) == "undefined") 	// IE
      		{ 
      		try 
      			{ 
      			req = new ActiveXObject("Msxml2.XMLHTTP"); 
      			} 
      		catch(e) 
      			{ 
      			try 
      				{ 
      				req = new ActiveXObject("Microsoft.XMLHTTP"); 
      				} 
      			catch(e) 										// no luck?
      				{ 
      				return; 										// nothing to do then
      				} 
      			} 
      		} 
      	else 														// Mozzila
      		{  
      		req = new XMLHttpRequest(); 
      		} 
      	//
      	// Get <a href> tags and iterate on them
      	//
      	var tags = document.getElementsByTagName("A"); 
      	var i; 
      	for (i = 0; i < tags.length; i++) 
      		{ 
      		//
      		// Check if we got "fragment" as rel attribute
      		//
      		if (tags[i].getAttribute("rel") == "fragment") 
      			{
      			try
      				{
      				//
      				// Try to pull the referenced file from the server
      				//
      				req.open('GET', tags[i].getAttribute("href"), false); 
      				if (document.characterSet) 
      					{
      					req.overrideMimeType("text/html; charset=" + document.characterSet);
      					}
      				req.send(null); 
      				if (req.status == 200) 					// got the content?
      					{ 
      					//
      					// Replace the reference with the pulled in content
      					//
      					var span = document.createElement("SPAN"); 
      					span.innerHTML = req.responseText; 
      					tags[i].parentNode.replaceChild(span, tags[i]);
      					} 
      				}
      			catch(e)											// couldn't pull it from the server (maybe preview)
      				{
      				return;										// don't do anything then
      				}
      			} 
      		} 
      	} 
      
      //
      // The following lines will automatically parse all the pages 
      // where this script is included by attaching the HtmlInclude
      // function to the onload event.
      //
      if (window.attachEvent) 								// IE 
      	{ 
      	window.attachEvent("onload", HtmlInclude); 
      	} 
      else 															// DOM
      	{  
      	window.addEventListener("load", HtmlInclude, false); 
      	}
      And then where you want the file (prodnames.html) to appear just have

      <a href="prodnames.html" rel="fragment"></a>

      You may need to upload prodnames.html via Advanced / Additional Files.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        this is a very clever way to go about things.

        i love this technique. nice and simple.

        but not SEO friendly.

        Comment

        Working...
        X