Sidebar list with cakephp - ajax

I want to make a sidebar list so when the user click on the item all the information that related to this item is viewed in a specific area in the same page , and its the same for all items,what is the best way to do that ( AJAX pagination or normal JQuery ) or there is another way to do that?!

The best way to do that is using Extending Views it allows you to warp one view to another .Combining this with view blocks gives you a
powerful way to keep your views DRY.
for more details visit those links :
Extending Views : http://book.cakephp.org/2.0/en/views.html#extending-views
Using View Blocks: http://book.cakephp.org/2.0/en/views.html#using-view-blocks

Related

How to programmatically load different partial views in same template page in umbraco 7?

Can anyone give me an idea about how to do this? My goal is to build a multi step claim submission form where user need to provide information for different sections. I am using VS2015 and Umbraco 7. Thanks.
In my opinion if you want to do it all from one template, it would be best to use a javascript/jquery solution that hides and shows different sections/divs as needed. These divs can be rendered from the partial views. I'm not sure if this works but maybe if you have one Form and all of these divs underneath it, you only need one form button and just submit at the end (I'm pretty positive this would work as the partial view elements would just be rendered as elements inside the form). But if not the values can be stored either in Jquery Data, or just using hidden variables, etc.

Joomla 3.2 - Load Component View from Specific Menu Item ID inside Another Component

I'm trying to get my head around Joomla 3.2's new framework and develop a capability/feature in a custom component (lets call it com_custom) that can load com_content's category blog view within com_custom's view, using the category blog's menu item id!
There are quite a few codes that I saw here and around the web that only load the default view of the 'imported' component, rather than the view specified in the imported component's assigned menu parameters. Also, most of these codes use deprecated functions, so I'm quite lost now.
So what I need to be able to add is:
Include a category blog view (say from menu item id 223) within com_custom's current view.
It should import all of the parameter setting of the category blog's menu item.
It should not be in an iFrame
Any help is much appreciated!!!
You can't include com_content because it makes use of the JPATH_COMPONENT constant in 14 different places, most notably in content.php (the main file that's loaded, even before the controller) and in most views, in order to load helpers.
These are the first two ways that come to mind to overcome this limitation:
Instantiate the articles model, load the data, and use your view to display it; you'll need to dig into the menu table to find the params related to your menuid; Bewre: Search engines might consider the duplicate content as spam.
Insert a jquery ajax call to get the url of the menuid adding &tmpl=component i.e.
index.php?option=com_content&view=category&id=13&Itemid=522&tmpl=component
The latter will be much easier to implement. Search Engines will NOT see the different content under different urls, since it's ajax.
Regarding the limitation, see also this question:
Joomla how can i create model from other component

MVC3: Showing entity relationships in a view

I am new to ASP.NET MVC and I have a question regarding viewing entity relationships.
Say I have an entity called 'Person'. This holds the usual data relating to a person (Name, Email, etc). I also have a 'Notes' entity. Under EF, a 'Person' can have many 'Notes'.
I have a Person controller where I can view and preform CRUD operations on a Person object.
I can show the notes in the view easily but what is the best way to allow a user to add/edit/delete these notes from the Person view? I am hoping to do this using AJAX and not have the user move to a completely different page to add/edit/delete a note.
Thanks in advance,
ViperMAN.
When they edit a note, popup a jQuery dialog pointing to your URL to edit or have a separate Ajax.BeginForm() on the page that the details go into. When they finish the edit call a method to refresh the notes.
So:
1. In your Notes grid (or whatever)
you have an edit link for each note called "edit"
this link looks something like the following:
This one actually uses 'notes' : )
http://www.iwantmymvc.com/dialog-form-with-jqueryui-and-mvc-3
ASP.NET MVC | Problem about showing modal dialog using jQuery dialog widget
ASP.NET MVC modal dialog/popup best practice
Also beware of this scenario for multiple links:
MVC3 - Only first row link works well with Jquery Modal Dialog
Now the urls you use to populate the dialogs would be for example
/Note/Edit/10
One thing to note - jQuery validation needs to know about these new items that are being loaded via ajax into the DOM , so in your partial view you need to tell jQuery validation to include the new items - I'll edit in a bit to add this, have to grab it from another machine.

Drawing a part of a page only after another part was "submitted"

ASP.NET MVC noob here
I was writing a quiz application where a user can select her preferences (e.g. difficulty, number of question etc.), and once she hit a submit button - she got a new page with questions.
The preferences are represented as a "Preferences" object, and the questions are IEnumerable of Question.
This all worked well.
Now I decide both parts should be in the same page - and I don't know how to accomplish that:
Should I have a new model class that is a composition of these two parts?
And also - How will I make the "questions" part appear only after the user completed filling up her preferences and clicked a button?
Should I use AJAX?
I also read a little about partial views and RenderSection.. But I really couldn't understand which approach is the most appropriate for my scenario.
So how should I draw two parts of a page, where the second is only displayed after the first is submitted?
Thanks.
How familiar are you with AJAX? If I had to guess I would think a good way to do what you want to do is to have an AJAX call which is linked to an action when the user submits their preferences. The action can then return a partial view which you can have appear on the page without a reload via AJAX.

Orchard How can I style the summary of list items different in a page versus a widget

I am new to the orchard project, and have not been able to track down how this could be done (assuming its possible).
I have a data list called "Events" in which I have attached a list of custom data type objects which are of type "Event". I then have put a view of this list in a widget on my homepage - as well as displayed the list view page by adding it to my main menu.
I have found the information to update the summary of these list items by adding the proper view
for example adding the following view:
\Themes\PeaceCamp\Views\Items\Content-Event.Summary.cshtml
<div class="event">
<b>#Model.Title</b><br />
</div>
however this seems to update the view in the widget, as well as in the list view page. Since pagination only affects the page view - I presume there is a way to summarize them different in the two different areas - hoping someone could explain or direct me to the proper location to do that - Thanks!
My solution is all local at this time, so I cannot provide links as examples - and the only thing not done in the CMS would be the view added above.
You could add your own IShapeTableProvider (the stuff you describe comes from the Shapes class in Orchard.Core.Contents) that walks up the shape tree to find a parent zone and adds alternates accordingly.
This post might give you some ideas on how to do that:
http://weblogs.asp.net/bleroy/archive/2011/01/10/orchard-shapeshifting.aspx

Resources