Jump to content

mr-fan

Members
  • Posts

    848
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by mr-fan

  1. Just a small question on selector performance and room for improvments... i use a little function that renders me all archiv links like /2015/ /2014/ and so on...all years that are _used_ in the article system... This cause a selector without limit...and there will be many posts/articles in future now there are about 40 - it will scale up to 100 fast and more will follow...so here is the question about caching the find query or using other code...? Basic information i work with a URL segment approach that show me /year/ and /category/ overview pages. (Category or not the problem while here limit works and pagination is used) Code from the year archive: function renderArchive() { //check for url segments $seg1 = wire('sanitizer')->pageName(wire('input')->urlSegment1); //get all posts to check for years $posts = wire('pages')->find("template=artikel"); //get homepage url for the links $homepageurl = wire('pages')->get('/')->httpUrl; //get article root page for links $artikel_root = wire('pages')->get(1068); //get year list $out = '<h4 class="subtitle">Archiv</h4>'; $out .= '<div class="listbox1"><ul>'; //Setup for the year sidemenu $years = array(); // find the array of years for all events foreach ($posts as $y) { $dateY = $y->getUnformatted("publish_from"); $years[]= date('Y',(int)$dateY); } $years = array_unique($years); arsort($years); $year = ""; foreach($years as $key => $year) { // Output the year $class = $year === $seg1 ? " active" : ''; $out .= '<li class="'.$class.'"><a href="'.$homepageurl.$artikel_root->name.'/'.$year.'/">'.$year.'</a></li>'; } //close list $out .= '</ul></div>'; return $out; } Could this done better - or cached somehow (I'm not really experienced with caching such things) regards mr-fan
  2. I'm relative happy with pagetable extended - it is relative much work to get it nice rendered and cover the right UI for customers....but it works great. I've a setup with part_something.php templates that render the needed item... strong trimmed CKE for textfields without to much choices - but with a good prepared mystyles.js with many classes for p, lists and so on to choose styling) templates for textfields (with optionfields on with heading (H2) or text only and columns 1/2/3 templates for single big image, small imagegallery, text with image right/left, map and so on (some CSS tweak that the UI fits and all looks fine) using a .renderedContent CSS file to render only the pageTable like in frontend - this is a bit tricky if you wanna render/use a editor.css, too.... using different behavior for backend and frontend for special UI things....example linking images in frontend to the image like needed but in admin if you click on a image you get the edit link work or no link....so users don't get in wrong ways or open the image in the browser window... Using some easy [[HannaCode]] is rendered nice and my Glossar textformatter with terms in ||pipes|| is rendered, too. with the single templates i can ship extra instructions for every type of contendblock as a feature... So from my point of view i can easy give my user a contentblock system where he can choose how to build up the page and it look quite familiar like the frontend. On small projects i was using FREDI and this is very easy for endusers...in the forum i was watching a video from a complete frontendediting with RTE that looks awesome great, but i don't remember the threat and this only was a demo video from no open source things...(there was a logo/user with a deer....england i think....??) Best regards mr-fan
  3. Wanna say Thank you Ryan for this great piece of code! Is something like this in the actual core now? I've read the changelog but don't see seomthing like this...or overread it... Best regards mr-fan
  4. just a easy one...as a little christmas present. My clients sometimes have problems to find the view link... so here some example CSS for ProcessPageEdit.css in /templates/AdminCustomFiles/ #content .WireTabs #_ProcessPageEditView { color: #69b023; font-weight: bolder; } #content .WireTabs #_ProcessPageEditView:before { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; transform: translate(0, 0); content: "\f06e\00a0 "; } #content .WireTabs #_ProcessPageEditView:hover { background: none; text-decoration: underline; border-color: transparent; } using BernhardB 's famous giphy tool it looks like: (just a example with fontawesome and bold to get the idea) regards mr-fan
  5. I wish all a great end of 2015 and a even better 2016! Best regards mr-fan
  6. There is a easy way to enhance the delayed output methode that don't get to abstract... my setting is based on a tipp from horst i think... in my templates folder i've simple a new folder named site/templates/layouts/ and there i have special layout if needed. in my _init.php: //default layout for output $myLayout = 'default'; in my _main.php: //output layout for main page content include("layouts/{$myLayout}.php"); while this code is placed where the whole complete content between header/menu and footer magic happens...all other stuff like columns or sidebars are maintained in the default layout for example: //default layout is two column layout with right sidebar for submenu or article pages echo $headerContent; //see _init.php - some heading stuff //wrapper section and some space echo '<section class="container page-content" >'; echo '<hr class="vertical-space2">'; //start page content echo '<section class="eleven columns">'; echo $content; echo '</section>'; //sidebar content echo ' <aside class="four columns offset-by-one sidebar">'; echo $aside; echo ' </aside>'; //end wrapper echo ' <hr class="vertical-space2">'; echo ' </section>'; or the full_page.php layout: //default layout is two column layout with right sidebar for submenu or article pages echo $headerContent; //see _init.php - some heading stuff //wrapper section and some space echo '<section class="container page-content" >'; echo '<hr class="vertical-space2">'; //start page content echo '<section class="sixteen columns">'; echo $content; echo '</section>'; //end wrapper echo ' <hr class="vertical-space2">'; echo ' </section>'; and in the _template_ files i setup the content vars used in the layouts and overwright the layout setting if needed. example basic-page.php where the user can set the aside sidebar on or off (optionfield full_page)... //basic-page.php = normal page content //render pagetable content - kind of blockbuilder for main content if(count($page->pt_content)>0){ foreach($page->pt_content as $l){ $content .= $l->render(); } } //page is with sidebar so we render Staff if it is set if ($page->flag_fullpage == 0){ // 1 is checked, 0 is unchecked $aside .= renderStaff(); } //set full_page layout if flag_fullpage is check on the default page template if ($page->flag_fullpage == 1){ // 1 is checked, 0 is unchecked $myLayout = 'full_page'; } so this is only one more layer to get different layouts for different or the same templates... this is just a easy example - but if you use url segements for articles (root-page/year/month or root-page/tag) you could switch the layout for these...and so on. i'm not the fan of making simple frontend layouts to abstract...so may this helps you forward. Best regards mr-fan
  7. @kongondo this is a great project sorry for ot - but may i know why this community is so great...
  8. The trick is - really al content is a page in PW - page is _not_ the term like in other CMS...so generally _all_ pages are reusable groups of fields. Repeaters and Pagetables are only a special input or better editing interface for some kind of content. Behind the scene a Repeater or a Pagetable are using real pages.... welcome to Processwire be not afraid you are at home....
  9. Hiting directly on WP (or other systems) always has it's bad feelings for the client - ranting on other systems is always no good way to sell your own product. Personally i'm in a position that most of my few clients are really non web affine and they have no clue about different tools or how to use them...but they know wordpress, too. But i show them the last half year security problems (without knockin down WP and stay ojective as far as i could) and we are ready to go one step further with PW and no other system...but i could imagine the problems with business clients that have dangerous ssuperficial knowledge that makes your life harder! Best regards mr-fan
  10. important is when you get this - while installation or after that....since this part of the code only check for the page->url and redirect you to finish basic settings first...nothing special here. regards mr-fan
  11. So after some smalltalk to Luis and some xmas madness...it's all there as kind of little christmas present. A OS siteprofile released under MIT so it should be easy possible to use parts of that profile in own projects and keep credits to the original creator. Github Repo: https://github.com/mr-fan/Officesuite Thanks again to Luis for his permission to release it to the community. Best regards mr-fan
  12. Don't have worked with PW comments so far but what's about Lister Pro - could Lister grab comments from pages and show them nice?
  13. Different set of tools here (but based on somas great wordlimiter! I don't use it in a module via hook just in my _func.php and i use it on several different strings to get clean values for example a sumary of the body text if no meta description is set...and so on. regards mr-fan /** * Wordlimiter cuts a textarea only after complete words not between * used seo function and in some templates */ function wordLimiter($str = '', $limit = 120, $endstr = '...'){ if($str == '') return ''; if(strlen($str) <= $limit) return $str; $out = substr($str, 0, $limit); $pos = strrpos($out, " "); if ($pos>0) { $out = substr($out, 0, $pos); } $out .= $endstr; return $out; } /** * Alternative with regex for striptags function * used for seo function and in some templates */ function ripTags($string) { // ----- remove HTML TAGs ----- $string = preg_replace ('/<[^>]*>/', ' ', $string); // ----- remove control characters ----- $string = str_replace("\r", '', $string); // --- replace with empty space $string = str_replace("\n", ' ', $string); // --- replace with space $string = str_replace("\t", ' ', $string); // --- replace with space // ----- remove multiple spaces ----- $string = trim(preg_replace('/ {2,}/', ' ', $string)); return $string; }
  14. https://processwire.com/talk/topic/11298-textformatterglossary/ You need a type of glossary ....feel free to try it with my little textformatter ;-) Best regards mr-fan
  15. OK Thank you for reply. We could use GPL 2.0 or 3.0 main difference would be that with 3.0 sublicensing would be allowed. We could go with this http://choosealicense.com/licenses/gpl-3.0/ and you could set some notes from you as creator - or not just as you wish. For the copyright notice i need a name + email and we are ready. regards mr-fan
  16. @diogo - i know that - i only give a hint to all that are interested in using or building on this application... I don't have the time to support this site profile - i only could take the time to set it up for Luis as OS to provide it as a usecase to study for other PW users. There are a lot of good ajax implementations, data usage, own frontend stuff and html2pdf examples that are useful for beginners and interested people. ...Waiting for Luis with his decision on the license topic and then i'll upload the site profile... regards mr-fan
  17. Here we are Luis.... just set up a public repo: https://github.com/mr-fan/Officesuite Just created a exported siteprofile from a actual 2.7.1 PW version. So every one could install it simple as a site profile. Now the last question is the license and your permissions and wishes about that topic. May we should go with GPL or release it as simple Public Domain: http://choosealicense.com/licenses/ For me i think it could only stay as a example application for learning some stuff - the app itself can only used partly while some things in accounting and billing changed and everyone that use this app should care about this things (for example IBAN and BIC instead of banking accont number...) But it is your piece of work and it is your decision. @all - this is a german language application and for multiligual frontend we have to change every hardcoded string in the templates....so to a multilang working out of the box app some work is on the road...that i could not do alone. So every one that is interested in helping could send me a PM for further work on this - or every one could use it as it is... regards mr-fan
  18. This methode works for the complete /template/ folder, too....so you could have a whole dev version and change it to live and back if there was problems.... From Diogo's tipps to bookmark: https://processwire.com/talk/topic/2475-quick-tip-for-testing-on-live-website/#entry23571 Best version i see on this topic for me i copy the template folder and rename it to /dev/ and use the snippet from the post above...make a backup of the live templates and copy the dev files...so you can create simple steps. Not that perfect like versioning with git - but for small/medium websites it should be a save methode to test and change things live without a risk. regards mr-fan Edit: Additional there is a great recipe from Raymond on this topic https://processwire-recipes.com/recipes/use-different-sets-of-template-files/
  19. one of the best resource on this topic: http://nikic.github.io/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth.html general more simple stats on what PHP handling has impact on speed: http://phpbench.com/ regards mr-fan ...'i'.'like'.'this'.'style'.'too'.'but'.'it'.'seems'.'that'.'in'.'fact'.'it'.'is'.'slower'....
  20. Thank you for the screenshots. It's a nice User Interaction on this topic. Best Regards and sorry i forgot in my post to say welcome to the forum!
  21. Could you give some insights from the handling of the sessionblogs - have you created a frontend UI for this or did they use the PW backend. For me i would change the topnavi to some simple black fitting icons above the "hotbox" so you have two navigation areas left and top right - the topnav bar now don't hit the design of the rest and is little bit irritation while i have to look left and right - but that is as always just a personal point of view The most important thing is that you've found Processwire and have fun - all things that are build while having fun in general are mostly not that bad! Best regards mr-fan
  22. Thanks you very much. I start to create a site profile from it this weekend then we could talk about the github repo and the os license... (Just short from mobile)
  23. sorry for the delay of my answer - i'm a little sick at the moment... i would provide some help to get this running. I don't think there should be much to maintain / support more prodive the app as download to learn build own stuff from it like a really professional usecase demonstration. How far i remember it is based on a 2.3/2.2 PW Version so @Luis have you the latest binaries from your project and send me a link. I've bought it last year to learn from a real life example app - but i don't now if this was the latest version? Next step could be update the PW version to actual stable and export it as a site profile so it would be more flexible to setup - further we could ask the guys from lightning.pw if we can setup a demo site...all done. regards mr-fan
  24. There are very easy ways to get a dashboard like the old example... take a look at https://processwire.com/talk/topic/11141-dashboard-redux/#entry104459 and https://processwire.com/talk/topic/9160-dashboard-with-add-and-edit-page-buttons/#entry88619 you can easy build a dashboard page use MarkupAdminDataTable for small lists and some action buttons for new pages and so on. And there is Lister Pro to generate easy and nice own admin pages for real big data like articles, events, all kind of entries... regards mr-fan
  25. There are many former really great modx members out there in this wild hood... Very warm welcome to your own new journey to redefine your thinking and workflow.... Please use google to search the forums (this the only con of this forum) to get more and better information about the force of PW! Best regards mr-fan
×
×
  • Create New...