Jump to content
  • 0

Template Content


Bit Bayou

Question

I'm working on an ajax template. I'd like to have a way to add/remove the template on the fly. I was thinking I could do this by the query string; something like this at the top of structure.pdt

<?php
	if( $_GET['template'] == "off" )
	{
		die( $content );
	}
?>

So if the url contained ?template=off it would echo $content and then die... nothing else! If it doesn't die here, it'll continue down to output the full template, which is included below this in the file.

 

Not getting the desired out come; seeking possible option ideas?

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Pages like the main client page make ajax requests to load widgets, and your structure change is probably causing those to return only their template. There may also be missing javascript files necessary in those templates that may be contributing to that as well.

 

Typically, you create a view that can or cannot support its content via ajax, and the controller makes this determination based on whether the request was made via ajax.

Link to comment
Share on other sites

  • 0

What about an iframe? I'd like to embed my blesta install in to an iframe using one view, and the default view for direct access?

 

Is there a way to control the view style via query string?

 

I'm referring to the app/views/client/ folder. In there, there's a folder named default/ I'd like to create a duplicate folder, but with my customization named template1/ and then create this iframe:

<iframe style="width:100%;height:98%" src="/blesta/client/?view=template1"></iframe>

Where it would show template1/ to those requests. but default/ when you access /blesta/client/ directly

 

I know I could probably, pretty easily, code this in to my install. Just not a fan of having to keep updating my code every update!

 

I'll do what I have to do to make what I want work; just thought it was worth a request mention!

Link to comment
Share on other sites

  • 0

Sorry for the multi-post! The reason I'm asking about template switching is more or less to allow for a mobile phone version. Are there any plans to add any more built in mobile support in the near future?

 

I don't think a dedicated mobile version will be necessary when 3.2 comes out (responsive bootstrap client/public interface).

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
Answer this question...

×   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.

Loading...
×
×
  • Create New...