-
Posts
2,776 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
@pwired, i have it running on shared hosting and the speed is fine; i can only imagine how much faster it will run with combine/cache/minify enabled and on a VPS; certainly getting much higher speed ratings out of the box than Shopify, which AFAIK doesn't offer any caching or asset combining/minifying..
-
Hi All - I'm helping out a client who is setting up an ecommerce site... We had originally planned and started on a processwire+foxycart site, however they need a ton of user account functionality, as well as advanced product management which is all easier/faster/cheaper accomplished with Prestashop, and they need it faster than I can build it in PW... I want to find them a host that will work really well for this and was considering this Servint plan, with the cPanel: SolidFire Essential 3 GB 50 GB 400 IOPS 1000 IOPS 6000 GB 4 $69.00 i need something that would perform from a server perspective as good as a hosted service like Shopify, and i want them to have enough support so that they don't need to call me about server related issues, as i can't offer SLAs at this point (too small and total freelancer).. any advice from current Servint customers, or any alternates i should look at before signing up? I spoke to Servint and i'm pretty much sold on them (even with the recent downtime...) on a side note - has anyone here worked on Prestashop sites, have any advice or recommendations about that? I tried many systems (lemonstand, shopify, volusion, ecwid, magento etc.) but Prestashop seems to have a special set of features that make it work really well for clothing and fashion, and the other systems basically pale in comparison, at least for this specific application... i like the admin well enough (better than the other systems mentioned) and seems put together decently enough;
-
yeah - sorry there was an error: if($count !== $total) echo "<div class='col-md-4'><ul>"; that should fix it and make it start the new column; you should be able to put back your variable logic how you want, to get the new region label; i think it's really important to comment your code, so that anyone looking at it can understand it, especially if you are posting to a forum; so commenting the logic all the way through would make it easier for us to follow what you're trying to do.. also can't guarantee this will work without being able to test it...
-
<?php function dmc_list(){ $dmcs = wire('pages')->find("template=dmc"); $dmcs->sort("parent.title"); $total = $dmcs->count(); $items_per_column = ceil($total / 3); $count = 0; echo"<div class='row'>"; echo "<div class='col-md-4'>"; //start the first column echo '<ul>'; // start your first list foreach($dmcs as $dmc){ $new_region = $dmc->parent->title; // why the same variable? $region = $dmc->parent->title; if($region !== $new_region) echo "<li class='list-group-item list-group-item-info'><b>{$region}</b></li>"; echo "<li>{$dmc->title} {$region}</li>"; if(++$count%$items_per_column) { // this will be false when we are on the last item in column echo ""; } else { // this part will run when we are on the last item in the column echo "</ul></div>"; if($count === $total) echo "<div class='col-md-4'><ul>"; // this will start a new column unless we're on the last item. } } // end foreach echo "</div>"; // end row using the modulus : $a % $b Modulus Remainder of $a divided by $b. so if the items_per_column is say 40, then there will be no remainder when the count hits 40 (false condition) so then it uses the false clause and closes the tags, and start the new tags; not perfect, but should give you some ideas about how to use some tricks to make it cleaner
-
there is quite a bit wrong with this; where are your opening <ul> tags? this looks like bootstrap 3 and you are trying to do a structure with a random # of columns (which you won't know ahead of time); looks like you want 3 items in each column, seems backwards... also i don't see why you need the container.. this is the best i could do with limited info, and you never defined $new_region variable <?php function dmc_list(){ $dmcs = wire('pages')->find("template=dmc"); $dmcs->sort("parent.title"); $dmc_total = $dmcs->count(); // if 100, then you have 34 columns, 3 rows? $column_total = ceil($dmc_total / 3); $count = 0; echo"<div class='row'>"; echo "<div class='col-md-4'>"; //start the first column echo '<ul>'; // start your first list foreach($dmcs as $dmc){ $region = $dmc->parent->title; if($region !== $new_region) echo "<li class='list-group-item list-group-item-info'><b>{$region}</b></li>"; echo "<li>{$dmc->title} {$region}</li>"; if($count !== $column_total) { echo (++$count%3 ? "" : "</ul></div><div class='col-md-4'><ul>"); } elseif ($count === $column_total) { echo "</ul></div>"; } } // end foreach echo "</div>"; // end row this definitely won't work, because it won't be consistent with bootstrap framework (too many columns) and also the you will need 2 counts, one for columns and one for the UL... if you give me more info i will fix the code i postef
-
https://twitter.com/servint
-
yes, we can help! you just need to add check_access=0 to your selector http://cheatsheet.processwire.com/selectors/built-in-page-selector-properties/check_access-0/
-
hey joe - what about something like this https://processwire.com/talk/topic/4991-sub-arrays-dates-times-and-pure-hell/?p=48484 which starts with the events and creates the array of years from the unique values of the event years, sort of coming from the other direction i guess..
-
Should I use Distinct in this case? Or Does Find() offer it?
Macrura replied to joer80's topic in API & Templates
you might need to make an array for your options and then use array_unique on the options list..let me know if you need code example; running the 2 loops should work fine, i think that is the processwire way, because you are pulling a value from a page so there is no way of knowing which are duplicates until after you put them all in that array http://www.php.net//manual/en/function.array-unique.php -
Finding the last page number for pagination?
Macrura replied to GuruMeditation's topic in General Support
i usually do this: $totalPages = ceil($total / $items_per_page); edit: ah - just noticed adrian got there first... -
have you checked the console - maybe there is some error; last time something like this happened to me there was an issue with a conditional field which was causing an error and halting parts of the editor screen to load....
-
i'm actually referring to PageTable but i don't know if there is a dedicated thread yet for that one; it would allow you to manage your child pages (add, edit, delete) from the parent page, in a sortable list; you can click on the item and edit it in a modal lightbox. you can also configure the fields to show in the table, and also custom auto name for the child page titles; so all in all, a very handy module, and the pages you manage don't have to be children, they could be somewhere else and you would make the pageTable field and setup the preferences there.
-
this module is really helpful - here are some example use cases that i'm using for: 1.) i made a field at the top of a gallery item template which reminds the user to crop the frames and center the images prior to uploading, as well as some suggestions for naming conventions; so now when someone is adding an item they see those instructions right at the top of the editor; if there is a particular problem with any item in the gallery, i could as the superadmin go to that item and make a further note that this item has a problem.. 2.) i have a template for a class session which is edited using the PageTable module, and when editing that info in the lightbox it can be hard to sometimes remember which class you are editing, so i have a field at the top that says "you are editing a session for {class.title}" so i'm using this for context-aware inline help
-
@pleini - welcome to the forum. to make it easy i would keep the editing all on one screen; then use URL segments to show the different field on each of the virtual pages; but if you need something where the fields are not fixed and you can't predict what the child pages are, you could use the new PageTable module and use the child pages for those; in that case you would still be able to manage the child pages directly on the main page;
-
FieldtypeSelectFile & InputfieldSelectFile
Macrura replied to Martijn Geerts's topic in Module/Plugin Development
ok, figured it out, sorry for posting an error that wasn't really this module... it was something to do with the conditional visibility of fields that was breaking my repeater... thanks again.. this is all sorted! -
@teppo - great! thanks again for this module.
-
FieldtypeSelectFile & InputfieldSelectFile
Macrura replied to Martijn Geerts's topic in Module/Plugin Development
@Martijn, thanks, i'm not sure what the problem is, just can't get values to save in these repeaters i have; i will keep testing/troubleshooting this; i tried changing the path, checking/unchecking the hide file extension, and i checked the database.. they just don't save.. thanks for you help.. nothing urgent... -
FieldtypeSelectFile & InputfieldSelectFile
Macrura replied to Martijn Geerts's topic in Module/Plugin Development
@martijn, thanks for that update! this works for sure now with regular pages, only issue is that i can't seem to get it to work with repeaters, i looked at the code but nothing popped out at me as to why this would be the case.. -
FieldtypeSelectFile & InputfieldSelectFile
Macrura replied to Martijn Geerts's topic in Module/Plugin Development
@Adrian - looks really good! In the use case i have, my video page has options for youtube, vimeo or local video; with the local video, some of them were very large sizes so i didn't feel like bothering with the uploader; for the html5 video, i have mp4 and webm versions of both, plus the poster image...so i have a media folder in /site/ for all of those things.. having the ability to let the user select the video file makes this whole thing possible.. but i will look into your module for sure on future stuff and i'm redoing a site now and will probably upgrade my system to use your module... will comment on that thread soon! -
FieldtypeSelectFile & InputfieldSelectFile
Macrura replied to Martijn Geerts's topic in Module/Plugin Development
hi Martijn - i'm pretty sure the value is not stored; i ran a quick selector and the field is showing as empty... -
FieldtypeSelectFile & InputfieldSelectFile
Macrura replied to Martijn Geerts's topic in Module/Plugin Development
having an issue with this, the select works fine, but the field doesn't save... any idea what might be causing that? cheers! -
$blue = $pages->get('name=blue');
-
Having an issue here with this - the markup field shows for the non-superusers, but they are not able to save the page, basically they get an error saying they are not able to edit that field, even though that field is not being edited... this is such a great module, and so needed for inline help and instructions, notes etc.. hope this is not a hard fix!!
-
FieldtypeSelectFile & InputfieldSelectFile
Macrura replied to Martijn Geerts's topic in Module/Plugin Development
this is great...! i was trying to write this module about 2 months ago and couldn't figure out how to do it.. edit: brilliant, works perfectly, and even works using ../ to get out of the templates folder... this is going to be extremely useful for html5 video, selecting files to be used instead of uploading to processwire page.... and in other situations where we want to store large media assets somewhere else in the filesystem.. many thanks for this. -
hi jordanlev and welcome. processwire is so flexible that you could probably emulate all of your favorite features of Concrete5 very simply and quickly, using some custom modules... I started with Joomla way back in '06 and i probably still retain a couple of concepts that i liked about that system (they might have had 1-2 good ideas); for example i tend to favor building my own navigation system like Joomla does, since i always tend to need a ton of flexibility with menus and i can't deal with being tied to the page tree. likewise there are plenty of wireites who defected from modx but still retain some of the logic of how that system worked, and apply it to their PW workflow; Recently kongondo released a blog module that is sure to close the argument for any remote reason to mention wordprass*... I started helping a couple of clients build shopify sites, and after using that system, looking at their templating language and seeing the backend management, i was surprised because i thought it would be more advanced; a simple example is with PW's image handling, which in itself saves huge amounts of time; with most other systems you have to resize the images prior to loading them into the cms.. but of course the thought immediately occurred to me about how easy it would be to 'build' a clone of shopify with PW, maybe using the shop module and a custom admin theme... so i really appreciate you explaining the pros/cons of Concrete5, and what innovations, workflow benefits etc that it uses... and i think some people here on the forum will probably come up with suggestions for how to implement those things with PW; i think you'll discover that because the way PW is structured, you can typically accomplish the same thing in PW in about 1/10 to 1/20 the code. (I know this for a fact as i have converted a couple of really complex wordpress themes to PW and the code trash was quite significant).. *spelling attributed to willyC