Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Could anyone recommend a good Drag-and -Drop framework out of the box ?
Something like this jquery-ui example, where one can drop a set of widgets onto a sort of Dashboard layout page - example using a photo gallery http://jqueryui.com/droppable/#photo-manager
I just recently found this very cool jquery-ui and Bootstrap 3.0 based dynamic layout tool called gridmanager - http://neokoenig.github.io/jQuery-gridmanager/
You can also check out demos here http://neokoenig.github.io/jQuery-gridmanager/demo/
So with this in mind, I'd like to add a drag/drop sidebar which will allow me to drop "gadgets" onto the grid system.
I'm using Kendo UI as well as JQWidgets, but I'm a bit unsure of how to integrate drag/drop onto this gridmanager system.
After adding jquery-ui and gridmanager js/css files to my index page, here's what the code looks like :
<section id="dashboard-view" class="mainbar" data-ng-controller="dashboard as vm">
<section class="matter">
<div id="mycanvas">
<div class="row">
<div class="col-md-6">
<p>Content</p>
</div>
<div class="col-md-6">
<p>Content</p>
</div>
</div>
</div>
</section>
</section>
<script>
$(document).ready(function () {
var gm = $("#mycanvas").gridmanager({ // fluid widths
controlPrepend: "<div class='row-fluid'><div class='col-md-12'><div id='gm-addnew' class='btn-group '>",
rowClass: "row-fluid",
rowSelector: "div.row-fluid",
rowPrepend: "<div class='row-fluid gm-editing'>"
});
$(".myexternalcontrol").on("click", function (e) {
// Example use of internal gridmanager function:
gm.appendHTMLSelectedCols('<p>my content to append to all my selected cols</p>');
});
});
</script>
Again, I'd like to setup a sidebar or topbar of widgets which can be dragged onto each grid section below (see screen shots).
and here's a screen shot of how it renders in my beta website.
Thnks in advance for your advice.
regards,
Bob
I'm one of the authors of gridmanager.js. Firstly, jqueryUI is required by gridmanager, so you've already got the drag/drop functionality on the page. However, GM is already using the draggable/sortable jqueryUI features, so be warned you might get some clashes.
GM actually creates a lot of temp markup (and then strips it out on preview/save) - have a look at the generated source code - you'll see divs of class "gm-editable-region" - might be worth trying to make that class a 'droppable' region (i.e, so other things can be dropped on it). You might have to extend gridmanager's activateCols function in order to 'reactivate' the droppable regions when it's gone through the preview process though.
Good luck - the github issue queue is here https://github.com/neokoenig/jQuery-gridmanager/issues
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I need to add an icon near myLink in razor view,
in .html page i use ` Requête optimisée.
Now i have
#Html.ActionLink("Requete optimisée", "Index", "Requete")
Dont know where to add my icon .
I wouldn't use ActionLink and would do the following:
<a href="#Url.Action("Index","Requete")" class="my-link-class">Requete optimisée
<div class="my-icon"><img src="#Url.Content("~/icon.jpg")" alt="Icon Image" /></a>
More code but also more freedom and control over what is going on.
If you want show an icon just put a img tag before your link:
<img src="~/Content/Images/Image.png" />
#Html.ActionLink("Requete optimisée", "Index", "Requete")
And if you want to display image link then use this:
#Html.ActionImage("Requete optimisée", "Requete", "~/Content/Images/Image.png")
This question already has an answer here:
jquery mobile - loadPage issue
(1 answer)
Closed 8 years ago.
It's possible to put the content of a navbar in a different file on Jquery Mobile? I have a navbar with a lot of options, right now the file is so big so I want to divide it on different files. Right now I have something like this:
<div data-role="content">
<div id="content1">
<p>This is 1 (How to put this on another page?)</p>
</div>
<div id="content2">
<p>This is 1 (How to put this on another page?)</p>
</div>
<div id="content3">
<p>This is 1 (How to put this on another page?)</p>
</div>
</div>
Its possible to place the content on a different file? I don't need to redirect to another page,what I need is to display the content in the same page, even when the content is in another file.
You could use the jQuery.mobile.loadPage() method to load an external page from a file.
Example:
$("#loadpage" ).on( "click", function() {
$.mobile.loadPage( "../templates/about.html");
});
At the bottom of my page, there are four big square link tabs (called "individual", "group", "child" and "family"). Those tabs work fine on my desktop computer, but for some reason they don't work on iPad.
The strange thing is that when touching them on iPad, the hover effect functions but then nothing happens. What is going on with these links?
Here's the HTML of one of the four tabs:
<a href="https://www.mud-kings.com/events/individual/" id="a_price_li1">
<img src="http://www.mud-kings.com/wp-content/themes/mudkings/images/register_individual.png" id="register_individual" class="register_tab" style="display: block;">
<img src="http://www.mud-kings.com/wp-content/themes/mudkings/images/register_individual2.png" id="register_individual2" class="register_tab" style="display: none;">
</a>
With the following jQuery code attached to it:
jQuery('#a_price_li1').hover(
function () { jQuery('#register_individual').css('display','none'); jQuery('#register_individual2').css('display','block'); },
function () { jQuery('#register_individual').css('display','block'); jQuery('#register_individual2').css('display','none'); }
);
#drake035, I managed to find some similar questions (with answers) asked by other people with more or less the same problem. My suggestion would be take a look and see if the information provided in there solves your problem (since I have some doubts I will ask you bellow).
iPad hover/click issue
hover effect on a tablet (i.e. iPad)?
In order to be aware of the current situation, what kind of knowledge in web programming do you have?
What makes you think there is the problem only?
Greetings, Martin
i am using twitter bootstrap in my asp.net project and what i have is a menu bar at the top. some of the menu items are supposed to open a modal with external HTML content. i tried putting an iFrame in the div which is to be become the modal. this does not work well in that it i cannot get the modal window to auto size to the content of the external HTML page.
i am curious to know if there any recommendations on how to correctly use the modal window with external content or any other jQuery plugins which work correctly with twitter bootstrap.
thanks in advance.
In case anyone else comes here from Google... I found http://blog.assimov.net/blog/2012/03/09/ajax-content-in-twitter-bootstrap-modal/ helpful.
Relevant code (copied from the blog, not trying to claim credit):
<a class="btn" href="/path/to/your/page.html" data-toggle="modal" data-target="#myModal">Launch Modal</a>
<div class="modal fade" id="myModal"></div>
$("a[data-toggle=modal]").click(function() {
var target, url;
target = $(this).attr('data-target');
url = $(this).attr('href');
return $(target).load(url);
});
https://github.com/jschr/bootstrap-modal
You can load in content via ajax. I use this personally. Also feel free to check out www.bootsnipp.com Great resources, including this one can be found there.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am trying to get the url for a products reviews page in the sidebar on that products page. I know this can't be that difficult, but it is defeating me at the moment..
I can get the product page URL (basically the url for the page the sidebar is on) but not the reviews page... which is essentially the same url with -reviews.htm at the end instead of just .htm
Where am I going wrong? What call do I have to make?
In your (your theme) catalog.xml file find the section beginning with <catalog_product_view translate="label">
Look for <reference name="right">.
If your template does not have a right section in product view, add one in below content and enter:
<reference name="right">
<block type="review/product_view_list" name="product.info.product_additional_data" as="reviews" template="review/product/view/list.phtml"/>
</reference>
Make sure you have cache off, load your product page (hopefully a product with a review on there) and you should now have the necessary.
You'll also be wanting to have the 'add a review' box on the product page to make it easier for people to add a review. There are some really clumsy ways to do this that don't work properly. However, this is the easy, simple way...
Open the same layout.xml file you had earlier, go to the catalog_product_view section, go right to the bottom of the content section. Look for the final closing </reference> tag. Now add:
<block type="review/form" name="product.review.form" as="review_form" template="review/form.phtml"/>
Now go to the front end, add your testimonial and note how wonderfully it all works, complete with theme etc.
Hopefully, with this example you will begin to understand how powerful and useful the Magento layout xml files are.
Extra
Since it is a new block that is needed, you need new template file.
Add:
app/design/frontend/base/default/template/review/sidebar.phtml
Enter into it something like:
<div class="block block-reviews">
<div class="block-title">
<strong><span>Reviews</span></strong>
</div>
<div class="block-content">
<p>MacGuffin!</p>
</div>
</div>
Edit app/code/core/Mage/Review/Block/Product/View/List.php and add the helper URL function before the class closing brace:
public function getMacGuffin($id)
{ return Mage::getUrl('review/product/list', array('id'=> $id));
}
Now sort out your layout XML add to the reference left block or reference right, whatever, for the product page directives:
<block type="review/product_view_list" name="review_sidebar" as="macguffin" template="review/sidebar.phtml"/>
That gets you the link you wanted, in a nice sidebar block with some stuff you can CSS to. Copy it over to your main theme.
You can take what you want from the list.phtml template I pointed you towards earlier and do your own code to summarize your reviews or say something else if you have no reviews.
Does <?php echo $this->getReviewsUrl() ?> work for you?
Otherwise you can always get the product URL like you said, explode it on the ".", insert reviews and stick them back together. I don't think that's a fail-safe solution though, as the review URL's on my Magento installation look very different from the product page URLs, so you might break something during an upgrade. (e.g, my product page looks like domain.com/category/product.htm, but the review page is: domain.com/review/product/list/id/10450/category/281/#review-form)
Edit:
I dug a little deeper. I found the $this->getReviewsUrl() in a helper template at app/design/frontend/base/default/template/review/helper/summary.phtml.
That explains why you cannot use the method on the product page itself; it has a different context. The Block helper for this template at app/code/core/Mage/Review/Block/Helper.php has the answer though:
public function getReviewsUrl()
{
return Mage::getUrl('review/product/list', array(
'id' => $this->getProduct()->getId(),
'category' => $this->getProduct()->getCategoryId()
));
}
You can use this function's content in your template to generate the link you want.