Jump to content

mr-fan

Members
  • Posts

    848
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by mr-fan

  1. If you related to other services you always have to get there.... But theire service is easy to use for all - for non w0rdpre$$ users, too. and you could save this thumbs to a processwire imagefield to store the thumb at your server and deliver it from your copy and not from there server, so the don't track usage: http://webthumbnail.org//api-reference //How to capture a website screenshot and save it to a file? <?php $thumb = new Webthumbnail("http://your.website.com"); $thumb ->setWidth(500) ->setHeight(500) ->captureToFile($path); //this could be adapted with the API and some fields for the url or even width and height to save it in a imagefield! may this is more secure - only new thumbs don't work if the service is shut down or not available.... reagards mr-fan
  2. 1. First you have to create a new page with the admin template (under the admin!) 2. Choose the right "Admin" Process on this adminpage on the first tab (content) 3. Then a new row shows up and you can choose your own template that lives in /site/templates/ In this template you could work like with Frontendtemplate with the API and show some stuff there no borders...
  3. As addition if you wanna use this with a simple textfield for the url you could look into the code and use it in your template and set the variables with the API!
  4. mr-fan

    Hanna Code

    next HannaCode to crosslink the topics https://processwire.com/talk/topic/7930-screenshot-generator-url-to-img/#entry76654 !HannaCode:thumbnail:eyJuYW1lIjoidGh1bWJuYWlsIiwidHlwZSI6IjIiLCJjb2RlIjoiXC8qaGNfYXR0clxudz1cIjEyMFwiXG5oPVwiODBcIlxudXJsPVwicHJvY2Vzc3dpcmUuY29tXC9cIlxuaGNfYXR0cipcL1xuPD9waHBcclxuXHJcblwvXC9nZXQgc29tZSB0aHVtYm5haWxzIGZyb20gYSBzZXJ2aWNlIEFQSSBcclxuXC9cL2xpbmsgZXhhbXBsZTogaHR0cDpcL1wvYXBpLndlYnRodW1ibmFpbC5vcmdcLz93aWR0aD0xMjAmaGVpZ2h0PTgwJmZvcm1hdD1qcGcmdXJsPXByb2Nlc3N3aXJlLmNvbVwvXHJcblxyXG5lY2hvIFwiPGltZyBzcmM9J2h0dHA6XC9cL2FwaS53ZWJ0aHVtYm5haWwub3JnXC8/d2lkdGg9JHcmaGVpZ2h0PSRoJmZvcm1hdD1qcGcmdXJsPSR1cmwnPjxcL2ltZz5cIjsifQ==/!HannaCode Some little thumbnailgenerator....
  5. you mean something like this one: http://api.webthumbnail.org/?width=120&height=80&format=jpg&url=processwire.com/ this could made easy with hannacode module: https://processwire.com/talk/topic/3745-hanna-code/ here is some hannacode to import.....ready to use just like [[thumbnail]] or [[thumbnail w="200" h="100" url="www.your-page.com"]] !HannaCode:thumbnail:eyJuYW1lIjoidGh1bWJuYWlsIiwidHlwZSI6IjIiLCJjb2RlIjoiXC8qaGNfYXR0clxudz1cIjEyMFwiXG5oPVwiODBcIlxudXJsPVwicHJvY2Vzc3dpcmUuY29tXC9cIlxuaGNfYXR0cipcL1xuPD9waHBcclxuXHJcblwvXC9nZXQgc29tZSB0aHVtYm5haWxzIGZyb20gYSBzZXJ2aWNlIEFQSSBcclxuXC9cL2xpbmsgZXhhbXBsZTogaHR0cDpcL1wvYXBpLndlYnRodW1ibmFpbC5vcmdcLz93aWR0aD0xMjAmaGVpZ2h0PTgwJmZvcm1hdD1qcGcmdXJsPXByb2Nlc3N3aXJlLmNvbVwvXHJcblxyXG5lY2hvIFwiPGltZyBzcmM9J2h0dHA6XC9cL2FwaS53ZWJ0aHVtYm5haWwub3JnXC8/d2lkdGg9JHcmaGVpZ2h0PSRoJmZvcm1hdD1qcGcmdXJsPSR1cmwnPjxcL2ltZz5cIjsifQ==/!HannaCode Have fun! forgot to link the free service http://webthumbnail.org/
  6. where do you wanna show them? backend/frontend? https://processwire.com/talk/topic/6343-how-to-add-more-fields-for-processwires-user/ regards mr-fan
  7. Just bought listerpro and formbuilder to play a little bit and support ryans great work! It's a kinda like "win-win" birthday present situation. Especially the flexible CSV export is exactly what i need for pages.....very excited!
  8. Hi guys, just wanna ask a simple question and may i get a ok from some experienced guys or a no-way - that helps me to avoid trashing to much time. For now i love PW - and build some easy websites - but i've a real webapp on the desk that screws "i wanna go live". Since i'm working in a NGO for farmers that share manpower and maschines together and we did the clearance for this special kind of service. So we wanna build a webapp where clients could send us records online. Long words short sense..... I've read kongondo's tutorial about structuring (even with colors) but anyway i wanna ask if i'm on the right track. Visible Pages (Frontend): Home (with login for different roles) ->role/login ngo-admin -Website (App) for the NGO (who gets records) --Dashboard --Settings --Import/Export (get the records) ->role/login agent/company -Website (App) for the companys/farmer (who sets records) --recording (choose some refered clients, choose refered services add values and save) --clients (partners from the farmers / remitter) --maschines/service --settings --send/sync (or more a clearing for the ngo admin) Cats and Dataschema: --NGO's (may this solution would used from other district offices, too) ---district one ---district two ... --Companys / Agents (Farmers as agents that do work or rent a maschine) ->special one project can have several firms ---agent one ---agent two ... (pagefield for related clients of this agent, settings, reference for records...) --Clients / Firms (here all firms available all farmers with theire companys even the related firms that linked under companys/agents) ---client one ---client two ... (adress and other relevant stuff, reference for records...) --Maschines/Services ---service one ---service two ... --Records ---record one ---record two ... (specific data, reference on ngo, project and client) May you get the idea - it's not so easy if clients of clients have clients, too regards mr-fan Edited some definitions for a better reading. The NGO setup the projects for the agents that assign what clients/firms has a agent to choose and the clients/firms for that he works. And get the records for clearance like with manuel printed delivery order's. The Agent can record his works and commit them. The client/firm has no login and it is only the data that is used by the agents like "contacts" or "remitter". Would be a kinda like an odermanagement but with not only two parties......
  9. Ok since some different things are up to the client now - but the main work was done i'd like to show my first work with PW and give some feedback and kind words about the workflow. First i've to say thank you - ryan for this awesome diamant of code and all members here that treat every other with respect and patience! Domain is not open until some bureaucratic things are ready. http://gs-altfraunhofen.de/ This was no big project but not really easy, since there was no real basic stuff to start with, and the existing things (like a strange version of the logo you could see now) are done by some teachers and changing them was a little hot political thing....hot pavement! For such a little project with less budget i give the easy http://purecss.io/ a try and work with that. Tried to give the website some individual notes, but stay with many given elements by the small CSS Framework (buttons, forms) to save time/budget for the client. Here some screenshots of the page and changing on responsive: Desktop Mobile Backend Some special modules that i used: FieldtypeEvents (with some changes) FormTemplateProcessor (with adding some spamdetection, hidden honeypot and a "leave blanc" field) MarkupSimpleNavigation PageListImageLabel ProcessAdminCustomPages VersionControl Some special adjustments and using of some modules: FormTemplateProcessor Get a Form from given fields in a backend template and save them as pages and/or send them to a mailadress....easy task with the FormTemplateProcessor. For some spamdetection a added a hidden field as a honeypot and a questfield to leave blanc to check against bots. //Changes for better Spamprotection with a hidden additional field as a honeypot // create a text input a hide it via CSS .Inputfield_name2 display:none - see CSS example on the end of this module $field = $this->modules->get("InputfieldText"); $field->label = "Name2"; $field->attr('id+name','name2'); $field->required = 0; $form->add($field); // append the field to the form //end changes /**and at the end**/ //Create a field quest in the form template with heading like "please show us youre human an leave this blanc" //Set the Spamfilter and check if field quest or spam are blank! $questfield = $this->input->post->quest; $spamfield = $this->input->post->name2; if(empty($spamfield) && empty($questfield)) { echo "<h3>Ihre Email wurde gesendet!</h3>"; // see if any errors occurred if(count($form->getErrors())) { // re-render the form, it will include the error messages $out .= $form->render(); } else { // successful form submission, so populate the new page with the new values. foreach($form as $field) { $this->contact->set($field->name, $field->value); } if($this->email) $this->sendEmail($form); //if($this->parent) $this->savePage($form); $out .= $this->successMessage; } return $out; } else { echo "<h3>Es ist ein Fehler aufgetreten - Sie haben das letzte Feld ausgefüllt bitte versuchen Sie es erneut!</h3>"; } //end changes Frontend Backend ProcessAdminCustomPages This is a real great module for custom made admin pages. You simple add a page to the admin setup the process and add a templatefile in your site folder! Admin stuff made easy even for non devs! example code from the imageoverview (CutomAdminPage Template): <?php // Bilderübersicht Custom Admin Page ?> <style type="text/css" media="screen"> /** * larget magnific popup */ .mfp-iframe-holder .mfp-content { max-width: 1200px!important; } </style> <script type="text/javascript"> $(document).ajaxComplete(function() { //add trigger class and modal setup $('.PageListActionEdit a').each(function(){ $(this).addClass("lb-edit").attr("href",$(this).attr('href')+"&modal=1"); }); $('.PageListActionNew a').each(function(){ $(this).addClass("lb-edit").attr("href",$(this).attr('href')+"&modal=1"); }); //setup lightbox $('.lb-edit').magnificPopup({ type: 'iframe', disableOn: 0 }); }); </script> <?php //get Magnific css and js $this->modules->get('JqueryMagnific'); //render PageListtree with setting the parent page $formImages = $this->modules->get('InputfieldForm'); // prep the form $wrapperImages = new InputfieldWrapper; // a wrapper $wrapperImages->attr('value', '<h2>Bilder</h2>'); $i = $this->modules->get('ProcessPageList'); // get the pagelist process $i->set('id', 1015); // setting the parent page $pageTreeImages = new InputfieldMarkup; // the placeholder $pageTreeImages->value = $i->execute(); // fill the InputfieldMarkup form field... $wrapperImages->add($pageTreeImages); // put inside the wrapper... $formImages->append($wrapperImages); // append the wrapper echo $formImages->render(); And as result i've a adminpage just with the imagetree. For this kind of websites where i've very less images and use it on different pages - i'd like to have a mediacenter - and this is the way i get it work. Using the image approach from somas imagemanger module: https://processwire.com/talk/topic/3219-images-manager-beta/ But only the setup for the templates (single image fields and cats) - and have an easy administration like the whole site in a PW style. One bad thing with a own usage of the ProcessPageList - while editing after save you will be redirected to the "real pagetree" not the custom one! So no problem, it would be much better to use a kinda a modal editing on this special content - no problem all there just to find and use. (Combined it with the PageListImageLabel to show some thumbs in the pagetree) For the images first i thought i change the Tree where in the Wysiwyg the image is choosen to insert - this works so far mor details here: https://processwire.com/talk/topic/7439-processpageeditimageselect-hook-and-change-default-page/ But then i decided to don't let the users handle images in the wysiwyg and added a fieldset TAB for images and populate them if the users choose some on the right place on every page. So i've with a Pageselect field (parent page is the image-root) a simple "click on the images to show gallery" possible on every page: Here some screens on the backend of the custom admin page for the images with the template from above: Did the same for the documents section where i again use soma setup for files as pages: https://processwire.com/talk/topic/4602-flexible-downloads-using-pages/ This is a real great tutorial - you can expand all you need for such documents for eg. a counter is simple as easy PHP: 1. Setup a single file field, a counter integer field and a template for the kind of files you are using f.e. doc.php, docx.php, pdf.php and now use such a template file <?php /** * doc.php */ if($page->doc){ $page->of(false); $page->counter += 1; $page->save(array("quiet" => true)); $page->of(true); wireSendFile($page->doc->filename, $options); } Benefits from files as pages are real SEO Links on documents and images like: http://gs-altfraunhofen.de/dokumente/morgenbetreuung.doc/ some tweaks on the contact-page and some others in the admin.php to get them always in the state i want them i've some code like this: /** * setup choosen templates to hidden - equal witch setting the user takes */ $pages->addHook('saveReady', null, 'makePageHidden'); function makePageHidden(HookEvent $event) { $page = $event->arguments(0); if($page->template != 'doc' && $page->template != 'docx' && $page->template != 'pdf' && $page->template != 'image-category' && $page->template != 'image' && $page->template != 'contact_form') return; // replace 'category-site' with your template name if(!$page->is(Page::statusHidden)) $page->addStatus(Page::statusHidden); } For me like wrote i'm not a developer, not a real good coder, but i like the way that PW (and this awesome community) teach me in the right direction and let me be free in the way to solve my challenges! So closing the circle and say again thank you to all that read this and contribute to PW and this forum! Have fun - best regards mr-fan
  10. May you have missed this one - it's great extension to PageTable and fits different contenttypes even with rendering in the backend for easy editing by the client.... https://processwire.com/talk/topic/7459-module-pagetableextended/ and you are right i've mostly well structured websites, or simple i love to structure them for the clients needs. (i've mostly nontech users that have to search in word to get the text bold - they love that i preset everything in a very easy way for them) If different layouts or blocks needed - i would think about the amounth and the usecases of them and use some PW features that i read about to get this work: First use normal pages with all the fields that needed but only show "users choice" of the fieldsets: https://processwire.com/talk/topic/4323-field-dependencies/ (Show contentblocks/wysiwygs/inputfields only if for eg. a checkbox is true [ ]two collums [ ] tree collums or maybe [ ] imagegallery) pro easy to setup and to maintain for the client - con no sorting of the contentblocks again a given structure...so not best solution Second shot would be a pagestructure like mentioned above: - fancy page with - special content 1 / own template for blockcontent only - special content 2 / own template for blockcontent only ... pro drag and drop of the blocks - rendering all together on the parentpage template - con editing is not so optimal (could be better with modal editing of the childpages maybe with an extra adminpage...not so hard to code that - even for me... Third shot would be the mentioned PageTableExented module to get it work - i don't have practise with it now but i think this would be the best solution for maximum 3-4 Blocktypes i think....but would be the last option for a usecase like yours becaus this module is not really scalable for many blocktypes. First option if i need some kind of variants or additional field on some pages - second would be the choice for me to get real different and many blocktypes working with mentioned optional adminpage for editing that kind of pagess - third would be great for changing easy contentblocks (text, image, wysiwyg) maybe for layer, image and contentsliders, articles with different setups, portfoliopages and so on... hope my kind of "nondev-nonsense" helps a little bit from the "amateur point of view" In lack of skills with coding i'm allways spend a lot of time in searching how far could i get with given parts and be not that fast on the "code it like i won't it path". - sometimes i'll get very far with think different on some things - sometimes i'm very envious that i've not really the time to learn more PHP and OOP.......but since i found processwire i think i could use both easy creating with the framework and learning faster while i've an API that i simple understand and a structure that i can easy setup to fit my/clients needs! - kind regards mr-fan (i've been very excited since i've read your first post here as a heavyweight C5 user calling in the PW forum - for me personally it's an honor - only by knowing your helpfulness and your postings - i think/hope this forum and community will meet your prospects)
  11. Some "Mindgames" Go further i could build some blocks to expand a page with PW, too. Build a pagestructure like this one - blocks - special content 1 - special content 2 ... Just add a new tab on the basic-page template call it "blocks" and add a pagefield with pageselect or just checkboxes from the parent "blocks" and create the output with some if's how the content have to be if some special content is loaded..... Ready to go flexible blocks for the client but exactly embedded in the content where needed. Not really flexible since all is preset - but expandable if client need it.
  12. i know the c5 structure (and i can remember you from the forum there - it's nice to see you here) and worked with a similar CMS that use modules as sections/blocks on a page.....and i know all the benefits! Done some testsites, one rebuilding from the used CMS to PW and on the run one new PW site from the scratch.....and i don't miss this blockbased sheme anymore. From the start i missed the easy things that possible with blocks/sections -> add a form there -> add a galerie here -> drag and drop the blocks.....but now i know with PW it is much more to think about the project first and then create it like it should be, than building fast on the fly in the CMS system. I made for me an overview of the content-blocks- that i need to be used in a flexible way on some/every/single pages and thought about the options in PW......didn't found a usecase where i don't get a solution. Only drawback is that a enduser couldn't expand the website like he wants (For e.g. put a new little form here, add a new gallerysection here, add a poll on this page). But this stuff should be worked out previous the client needs such things....since he and you don't give the client the power to mess up his site. I liked the way to work with contentblocks with different types - but i like the other way to create all that is needed and expand it if it's claimed, too! just some thoughts on the block thingi kind regards mr-fan (did like the idea/way of Concrete5, too but it's a resourcehungry, slow on sharedhosts, hard to translate beast )
  13. Just submitted PW here for tag CMS: http://oozled.com/resources/cms
  14. Ok just for the events usecase it is simple.....there should be no problem to make less intervalls since you have in the frontend output of the event a simple check. If you check the output of the event against the actual date there is no need to run the script to often since the site visitors don't see wrong content....and lets say once a day the script cleans older events out....some links: https://processwire.com/talk/topic/2448-show-date-published-on-a-page/#entry23246 https://processwire.com/talk/topic/24-publishunpublish-by-date-or-by-manual-means/#entry103 https://processwire.com/talk/topic/29-how-to-unpublish-a-page-without-deleting-it/ for the newsletter if no real experience for a good advice....
  15. It will depend what the cron job does, too! So how often the interval is really needed, or the script should run. And it depends on the server environment... So more infos should give you more detailed answers.
  16. ......and for just some little selects with not to much and not scalable entry there is a module like this: https://processwire.com/talk/topic/201-fieldtype-select-aka-drop-down/ just for the protocol an this topic......
  17. The holy grail thing......I'm not a real fan of the real mvc approach, too. But I thought that Russell looks for more dividing code from HTML.... For me I use functions, too and I like the _main.php approach....
  18. Yeah i like this TOC from laravel! This kind of sorting give a fast access for different topics. And tags for more detailed search/find things with tags like "gallery", "login", "save", "pagetree", "images", "module", "user"..... nico's minds would be great since he has the right domain for stuff like this....
  19. <div id='main'> <!-- main content --> <?php echo $content; ?> <!-- sidebar content --> <?php echo $sidebar; ?> </div> this would be the main.php and the basic logic would be in the _init.php like this: // if the current page has a populated 'sidebar' field, then print it, // otherwise print the sidebar from the homepage $homepage = $pages->get('/'); if($page->sidebar) echo '<div class="mydiv">'.$page->sidebar.'</div>'; else echo '<div class="mydiv">'.$homepage->sidebar.'</div>'; and in a pagetemplate you could overwrite the $sidebar or extend it! so all logic is in the _init.php (basic output) or the template for the pagetype! example special-page.php //overwrite it $sibebar = $page->specialField; //extend it $sidebar .=$page->specialField; just written fast written in the browser....
  20. just forked it and added some recipes....later i will add more and separate them in tags/groups https://github.com/mr-fan/concept i think a tag sorting would make sense here, too and some more sorting.....since we wanna better/faster availability for the snippets like in this forum.....so only date and alphabetical wouldn't be enough? But the basic concept is quite easy and easy usually the best equal for beginners or pros....
  21. this template approach is more like one step further to a template engine (or even call it a template engine)... You complete separete the logic from the code. the advantage could be that a desinger could use the given vars $title, $content, $sidebar and change the main layout with this vars.....but you are right it is not the reall holy grail....since some html tags in the pagetemplates, too..... it's just a other logic behind - you could choose what fits for you best. some like to have split in logical parts like header - content - footer - and some wanna have the main logic together and the content logic separate - it's up to you - regards mr-fan (Martijn was faster and more proper )
  22. mr-fan

    Quick Form ?

    google search for "beginner guide" or "code snipptets tutorials" finding this two: https://processwire.com/talk/topic/6731-beginners-guide-to-processwire/ https://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/ regards mr-fan
  23. Maybe a section for HannaCode would be great, too! This is something that is hidden in many threats, too like snippets.... HannaCode + some little instructions regards mr-fan
  24. Yes a big big "Thank you" to Soma for his approach!! I used this too and setup a admin page with the imagetree itself to manage them easy. Imagemanager was not really that what i want - but the structure is great. First pic shows a own AdminCustomPage with diogo's module and second pic shows a little jquery mod where i set the &modal=1 to the edit links on this adminpages....works great 20 lines code. Users can choose a image from the insert image dialog in the Editor or i build up little gallerys with an pagefield! PW is great with images, too - you can have the structure you need. All pic related to the content like productimages (makes sense) or for sites that using less images from one central managed folder/image structure to choose it is easy possible, too. Again thanks to soma for this - i'm using your files as pages approach, too!! ALL ARE PAGES ;)
×
×
  • Create New...