Jump to content
  • 0

Question

Posted

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?

11 answers to this question

Recommended Posts

  • 0
Posted

The idea here is so that I can access the data as needed via ajax, but also keep the full template view as a fall back-- incase the device can't do what I want

 

 

It almost seems to work on most pages except for the client portal client/ when logged in... ?

  • 0
Posted

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.

  • 0
Posted

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.

 

OK will reconsider route. Thanks!

  • 0
Posted

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!

  • 0
Posted

An iframe might work, but Blesta currently only uses the /default/ theme, and would ignore the attempted use of other theme directories under /app/views/client/. However, we plan to add support for multiple theme templates soon.

  • 0
Posted

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?

  • 0
Posted

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

  • 0
Posted

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

 

That's great, but how do I use a different view folder than "default" <-- This would be an awesome feature!!!

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