Jump to content

Jquery and Smarty


joedavis

Recommended Posts

I am working on templating WHMCS to fit my site design. I use a CMS for my main site and it generates my site menu. I am using Jquery to load the menu into the WHMCS template so I don't have to modify the template each time something changes on the site menu. This works quite well except on pages with forms because Smarty is used in the form action.

 

Here is what I have in the header.tpl file for pulling in my site menu:

<script type="text/javascript">
{literal}
 $(document).ready(function(){
  $("#LoadSiteMenu").load("http://i7media.net/sitemap.aspx #wrapsitemenu");
 });
{/literal}
</script>

 

On pages that have forms such as the Client Area Details, the site menu just doesn't appear. I don't get any errors.

 

You can view the site at http://i7media.net/clients.

 

Thanks,

Joe

Link to comment
Share on other sites

I figured it out. It had nothing to do with smarty. FF was not showing the content because I was using a non-ssl url to load the menu. On non ssl pages, this works fine but on ssl pages it doesn't. Anyway, to fix it I did the following:

 

{if $smarty.server.HTTPS eq "on"}
<link href='https://i7media.net/Data/Sites/1/skins/i7MEDIA/csshandler.ashx?skin=i7MEDIA' type='text/css' rel='stylesheet' />
	<script type="text/javascript">
	{literal}
		  $(document).ready(function(){
		    $("#LoadSiteMenu").load("https://i7media.net/sitemap.aspx #wrapsitemenu");
	      });
	{/literal}
</script>
{else} 
<link href='http://i7media.net/Data/Sites/1/skins/i7MEDIA/csshandler.ashx?skin=i7MEDIA' type='text/css' rel='stylesheet' />
	<script type="text/javascript">
	{literal}
		  $(document).ready(function(){
		    $("#LoadSiteMenu").load("http://i7media.net/sitemap.aspx #wrapsitemenu");
		    });
	{/literal}
</script>
{/if}

 

IT WORKS!!!! :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated