-
Adding a search to a blog on a Magento site
Hi Guys, Rather than me trying to explain it all over again, here is a link to my stackoverflow ticket - http://stackoverflow.com/questions/16916360/adding-a-search-field-on-blog-in-magento I'm new to PHP and need to build a search feature on a Blog on a Magento site. I'm really just looking for some advice. Will I need to build the search functionality from scratch, or does Magento offer something out the box. I know the plugin doesn't come with a search feature built in. Any help would be much appreciated. Thanks, Josh
-
Adding a search to the blog on a Magento powered website
I'm looking to add a search field for a blog on one of our websites which is powered by Magento. We currently use a third party add-on - http://ecommerce.aheadworks.com/free-stuff/blog.html I've contacted aheadworks and the blog doesn't come with a search capability. However they said I could use something like http://ecommerce.aheadworks.com/magento-extensions/advanced-search.html but I’m not sure if this is there sales team trying to flog us another product. I'm new to PHP and even newer to Magento so really looking for some advice. Is it something I can build myself with relative ease? Or it something like the plugin they've recommend something I should be heading towards? I'd like the search results to output on a separate template, to one where the blog posts are listed. I've googled for a while now and all I can find if a product search. Just a little bit of info on how the blog currently works. There are two pages on the site where there different blog posts show, and depending on the category you select when adding a post. This will determine which page the post is then pulled through on. Any help would be much appreciated. Thanks!
-
Filtering by category with Django
Hi all, I'm hoping i'm able to explain this ok, but could really do with a hand. Python / Django is reasonably new to me and i've now started doing more pratical projects. I'm currently trying to add a category filter to my template. Currently on the template there news, views and a blog. In the right hand column there is a category filter. What i want to be able to do is when you click on one of the categories, it takes you to a seperate template displaying all the 'news, views and blog' posts within that category. I'm having a bit of difficulty working out what I need to do. This is code that currently displays the posts on the template: def news_views_home(request, blogType): categories = BlogCategory.objects.all() all_news = BlogPost.objects.filter(live=True, type='news').order_by("-override_date") all_blogs = BlogPost.objects.filter(live=True, type='blog').order_by("-override_date") all_articles = BlogPost.objects.filter(live=True, type='articles').order_by("-override_date") return render_to_response('news_views.html',{ 'all_news': all_news, 'all_blogs': all_blogs, 'all_articles': all_articles, 'categories': categories, }, context_instance=RequestContext(request)) {% for news in all_news|slice:"3" %} <div class="blogSingle"> <h4>{{news.title}}</h4> <span class="date">{{news.get_date|date:"d F Y"}}</span> <p>{{news.summary|safe}}</p> </div> {% endfor %} {% for article in all_articles %} <div class="articleSingle"> <h4>{{article.title}}</h4> <span class="date">{{article.get_date|date:"d F Y"}}</span> <p>{{article.summary|safe}}</p> </div> {% endfor %} <h2>By category</h2> <ul class="icon"> {% for category in categories %} <li><a href="news-views/c/{{category.slug}}">{{category.title}}</a></li> {% endfor %} </ul> So my logic was to create another view then on that view, then write some logic that detect the category you have selected. The reason i'm using another view is because I want to render a different template. So they are all in the same list, rather than bring split up like they are on the current view. Any help would be appreciated. If you need anymore info please, let me know. Thanks, Josh
- ;pound& in dropdown
-
;pound& in dropdown
Hey all, Having some issues. I have a dropdown box displaying mutiple prices. However in IE7 / 8 the dropdown box is not rendering thr ;pound& symbol and displaying the HTML code. I'm wondering whether this is common issue. I can't find anything online and not come across the problem before. The site is built in Django / Python. <select name='MaxPrice'> <option value='100000000'{% ifequal MaxPrice "100000000" %} selected='selected'{%endifequal%}>No Limit</option> <option value='800'{% ifequal MaxPrice "700" %} selected='selected'{%endifequal%}>£700pcm</option> <option value='800'{% ifequal MaxPrice "800" %} selected='selected'{%endifequal%}>£800pcm</option> <option value='900'{% ifequal MaxPrice "900" %} selected='selected'{%endifequal%}>£900pcm</option> <option value='1000'{% ifequal MaxPrice "1000" %} selected='selected'{%endifequal%}>£1000pcm</option> <option value='1100'{% ifequal MaxPrice "1100" %} selected='selected'{%endifequal%}>£1100pcm</option> <option value='5000000'{% ifequal MaxPrice "1200" %} selected='selected'{%endifequal%}>£1200pcm+</option> </select> Thanks, Josh
- Javascript Calender
-
Javascript Calender
Hey all, I have a Javascript calender and it's got a funny issue where it loads fine however the events that are being pulled only show when you click the next month link then when you go back to the previous month the events then show. I've had a good look through the JS and can't seem to see what's causing it i'm not a JS guru at all i'm fairly new to it. var dateFormat = function () { var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, timezone = /\b(?:[PMCEA][sDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, timezoneClip = /[^-+\dA-Z]/g, pad = function (val, len) { val = String(val); len = len || 2; while (val.length < len) val = "0" + val; return val; }; // Regexes and supporting functions are cached through closure return function (date, mask, utc) { var dF = dateFormat; // You can't provide utc if you skip other args (use the "UTC:" mask prefix) if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { mask = date; date = undefined; } // Passing date through Date applies Date.parse, if necessary date = date ? new Date(date) : new Date; if (isNaN(date)) throw SyntaxError("invalid date"); mask = String(dF.masks[mask] || mask || dF.masks["default"]); // Allow setting the utc argument via the mask if (mask.slice(0, 4) == "UTC:") { mask = mask.slice(4); utc = true; } var _ = utc ? "getUTC" : "get", d = date[_ + "Date"](), D = date[_ + "Day"](), m = date[_ + "Month"](), y = date[_ + "FullYear"](), H = date[_ + "Hours"](), M = date[_ + "Minutes"](), s = date[_ + "Seconds"](), L = date[_ + "Milliseconds"](), o = utc ? 0 : date.getTimezoneOffset(), flags = { d: d, dd: pad(d), ddd: dF.i18n.dayNames[D], dddd: dF.i18n.dayNames[D + 7], m: m + 1, mm: pad(m + 1), mmm: dF.i18n.monthNames[m], mmmm: dF.i18n.monthNames[m + 12], yy: String(y).slice(2), yyyy: y, h: H % 12 || 12, hh: pad(H % 12 || 12), H: H, HH: pad(H), M: M, MM: pad(M), s: s, ss: pad(s), l: pad(L, 3), L: pad(L > 99 ? Math.round(L / 10) : L), t: H < 12 ? "a" : "p", tt: H < 12 ? "am" : "pm", T: H < 12 ? "A" : "P", TT: H < 12 ? "AM" : "PM", Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] }; return mask.replace(token, function ($0) { return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); }); }; }(); // Some common format strings dateFormat.masks = { "default": "ddd mmm dd yyyy HH:MM:ss", shortDate: "m/d/yy", mediumDate: "mmm d, yyyy", longDate: "mmmm d, yyyy", fullDate: "dddd, mmmm d, yyyy", shortTime: "h:MM TT", mediumTime: "h:MM:ss TT", longTime: "h:MM:ss TT Z", isoDate: "yyyy-mm-dd", isoTime: "HH:MM:ss", isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" }; // Internationalization strings dateFormat.i18n = { dayNames: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] }; // For convenience... Date.prototype.format = function (mask, utc) { return dateFormat(this, mask, utc); }; //<![CDATA[ function updateDatepicker(dates) { $('div.ajax-overlay').remove(); $('#calendar .ui-datepicker-calendar td a, #calendar .ui-datepicker-calendar td span').each(function(index, item){ if(dates[index] != '') $(item).addClass('event-day').attr("title",dates[index].join(' | ')); else $(item).removeAttr('href').parent().removeAttr('onclick'); }) } function getDates(newYear, newMonth) { $.getJSON('{% url events_calendar_dates 1111 22 %}'.replace('1111',newYear).replace('22',newMonth), {}, function(data) { if(data.error) { $('#calendar').remove(); } else if(data.days) { updateDatepicker(data.days);//data.days should be a list of string/false values corresponding to each day of the month and whether that day holds an event. for days that have events, strings should contain a html representation of the titles of that day's events } } ) } $(document).ready(function() { $('#calendar').datepicker({ dateFormat: 'yy-mm-dd', minDate: 0, firstDay: 1, onSelect: function(dateText, picker) { var dateVals = /\d{4}-\d{1,2}-\d{1,2}/.test(dateText) ? dateText.match(/\d{4}|\d{2}/g) : false; if(dateVals === false || !$('#calendar .ui-datepicker-calendar td a, #calendar .ui-datepicker-calendar td span').eq((dateVals[2] - 1)).hasClass('event-day')) { return false;//bad date format or not an event day } window.location = "{% url events_date "1111-22-33" %}" .replace('33', dateVals[2]) .replace('22', dateVals[1]) .replace('1111', dateVals[0]); }, onChangeMonthYear: function(newYear, newMonth, inst) { $('#calendar').append('<div class="ajax-overlay"><div class="ajax-loading">Loading Calendar</div></div>'); $('#calendar .ajax-overlay, #calendar .ajax-loading').css({ width: function(){return $('#calendar').width();}, height: '5000px' }); $('#calendar .ajax-loading').css({paddingTop: "120px"}); getDates(newYear, newMonth); } }); setTimeout("setDateFormat()", 500); }); function setDateFormat() { // Convert date formats $(".hasDatepicker").each(function() { currentdate = new Date($(this).val()); newdate = dateFormat(currentdate, "dd/mm/yyyy"); $(this).val(newdate); }); } If you need anymore information let me know, but I should it's something to do with the way you click next and that's triggering the JS to load which shows the events. Idealy this needs to be done on page load. Thanks in advance. Josh
- Fonts
- Fonts
-
Fonts
Hey all... Looking at using a custom font that a designer has given me for the website I am building. The font is 'American Typewriter'. I want to be able to use this font and for everyone to able to see it on there PC's without installing it. Do i just host it on the web server for this to happen? Thanks in advance, Josh
- Members Twitter
-
Cant get wrapper to move down
#wrapper { margin: 0 auto; width:900px; padding-top:20px; Give that a try. All you need to do is add margin or some padding from the top of the div. Hope that helps
-
What Does Your Desktop Look Like
Tom, please change your resolution xD
-
My Portfolio
The text also needs to be text and not an image. Looks far to pixelated! Make everything a tad smaller it will look 10x better... Do something about your pic, even if it another 'sketch' version does not look right. I would have a look at some other portfolios online and get some tips.
-
-
-
My Portfolio
Looks like a bebo profile. Change your pic. Like the menu at the top though!