Leaderboard
Popular Content
Showing content with the highest reputation on 05/05/2013 in all areas
-
I'm not sure what you're exactly trying to say here, but the answer is "definitely not." There's nothing WordPress can do that ProcessWire can't do. Actually I'd go as far as claim that it's quite the opposite. Articles or blog posts? Just create templates for those and start writing. In case that you need help for specific problems and/or parts or ideas, ask. If you'd prefer to start a proper blog from the scratch, check out Blog Profile. Did this answer your question or is there still something you're wondering?4 points
-
In TinyMce the normal image behavior is being replaced by the PWImage plugin. It's not difficult to unload the it in the plugin itself, but because it's in the core, I wouldn't advise you to do that. In the CKEditor module it's very easy to do this without touching the module, if you don't mind switching to it, here is how you do it: Go to the field settings, choose CKEditor as the inputfield type, and in the INPUT tab, and inside "CKEditor Settings" go to "CKEditor toolbar" and replace "PWImage" for simply "Image", then go to "remove plugins" and remove "Image" from the list. -- Edit: If you still prefer to use tinyMce, go to the file /wire/modules/Inputfield/InputfieldTinyMCE/InputfieldTinyMCE.js, and remove 'pwimage' from the InputfieldTinyMCEPlugins array in line 96. Beware that this file will be replaced in any upgrade.2 points
-
Create custom admin pages easily without having to build a Process Module especially for that. ☞ This module makes it easy to create simple admin pages but you can also create them in much more powerfull way without the need of a module. Have a look at this post written by Bernhard Baumrock to know how it's done https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/ ------- I just updated the module, I kind of merged the two versions and now it works with both stable and dev versions of PW. Only difference is that with the stable version you still need to create the child pages and with dev version that is not needed. The instructions are on Github. Enjoy ---- Download or clone from Github https://github.com/ocorreiododiogo/pw-admin-custom-pages Module page is here http://modules.processwire.com/modules/process-admin-custom-pages/1 point
-
Hi Folks, today we will learn how to set up a simple jquery plugin called calendario and fill events trough our admin backend. || ATTENTION || Modern Browser needed First of all, we need the jquery plugin. Grab your copy here: http://tympanus.net/...alendar-plugin/ Now create a new template file, lets call the file calendar.php In the next step we have to include all the needed files from the .zip package. You need the following .css files: calendar.css custom_2.css demo.css Just include them in the <head> </head> of your template file. Feel free to merge them together, so you could save some http connects. Now we need to include the needed javascript. Make sure you have included the latest jQuery library. Include the jquery.calendario.js and the modernizr.custom.63321.js right into the bottom of your template file. Save the calendar.php Now we will set up Processwire where the magic wil happen. We just need one new template. Create a new template called calendar. Assign the field headline to our template. Allow children to just use this template. Hit the save button. Now create a new Page as child of home and call it Calendar. Assign our calendar template to this page. Almost ready. Now we have to do some little scripting in our template file calendar.php Add this html markup to our calendar.php <div class="custom-calendar-wrap"> <div id="custom-inner" class="custom-inner"> <div class="custom-header clearfix"> <nav> <span id="custom-prev" class="custom-prev"></span> <span id="custom-next" class="custom-next"></span> </nav> <h2 id="custom-month" class="custom-month"></h2> <h3 id="custom-year" class="custom-year"></h3> </div> <div id="calendar" class="fc-calendar-container"></div> </div> </div> Now we have to call the javascript function, to get the calendar running. Just put this snippet right under the included jquery.calendario.js <script type="text/javascript" $(function() { var transEndEventNames = { 'WebkitTransition' : 'webkitTransitionend', 'MozTransition' : 'transitionend', 'OTransition' : 'oTransitionend', 'msTransition' : 'MSTransitionend', 'transition' : 'transitionend' }, transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ], $wrapper = $( '#custom-inner' ), $calendar = $( '#calendar' ), cal = $calendar.calendario( { onDayClick : function( $el, $contentEl, dateProperties ) { if( $contentEl.length > 0 ) { showEvents( $contentEl, dateProperties ); } }, caldata : { <?= getEvents(); ?> // this is our function to grab our events }, displayWeekAbbr : false } ), $month = $( '#custom-month' ).html( cal.getMonthName() ), $year = $( '#custom-year' ).html( cal.getYear() ); $( '#custom-next' ).on( 'click', function() { cal.gotoNextMonth( updateMonthYear ); } ); $( '#custom-today' ).on( 'click', function() { cal.gotoNow( updateMonthYear ); } ); $( '#custom-prev' ).on( 'click', function() { cal.gotoPreviousMonth( updateMonthYear ); } ); function updateMonthYear() { $month.html( cal.getMonthName() ); $year.html( cal.getYear() ); } // just an example.. function showEvents( $contentEl, dateProperties ) { hideEvents(); var $events = $( '<div id="custom-content-reveal" class="custom-content-reveal"><h4>Termine am ' + dateProperties.day + '. ' + dateProperties.monthname + ' ' + dateProperties.year + '</h4></div>' ), $close = $( '<span class="custom-content-close"></span>' ).on( 'click', hideEvents ); $events.append( $contentEl.html() , $close ).insertAfter( $wrapper ); setTimeout( function() { $events.css( 'top', '0%' ); }, 25 ); } function hideEvents() { var $events = $( '#custom-content-reveal' ); if( $events.length > 0 ) { $events.css( 'top', '100%' ); Modernizr.csstransitions ? $events.on( transEndEventName, function() { $( this ).remove(); } ) : $events.remove(); } } }); </script> We are almost finished, but we are missing some very essential, have a look to our javascript. We are calling a function named getEvents() This function will grab our events and fire it right to our calendar. So here is the code: function getEvents() { $events = wire('pages')->get("/calendar/")->children(); foreach ($events as $event) { echo "'$event->title' : '<span>$event->headline</span> ',"; } } Put this snippet above the javascript includes. We will now create our first entry. Go back to the PW admin backend and create a Child of Calendar. Title and name need the Date on which the event has to be displayed. You have to form a date in this format: mm-dd-yyyy e.g. 12-27-2012. The headline field is our Event description. Hit the save button, go to your site and enjoy your event calendar. With a little coding you could extend the calendar to let it look like mine attached as screenshot. Hope this was useful to somebody. Cheerio.1 point
-
Check it out this page with useful jquery plugins. Might help you!1 point
-
Wait. Why are you using fopen()? This is for opening files on the server. Or I'm very far from understanding what you want, or something is very wrong here I think this is what you're after http://processwire.com/talk/topic/22-how-to-build-a-news-page/?p=51 Edit: I'm predicting a little problem with Ryan's code that I linked to if you use it with a tinyMce field, because it doesn't take in account the html tags that the formatter will add to it. So, you will have an opening <p> but most likely, you won't have the closing </p>. I guess this is quite safe to assume, so you could echo the summary like this: echo $summary . "</p>";1 point
-
@PWired, I've seen this approach before but it has various problems. One, it will invariably cut words in the wrong places, leaving some sentences "hanging". It can cut off a perfectly "harmless" word into one that has a totally different (even offensive) meaning! The better approach, IMO, is to use a summary field for summaries and a body/content field for main content. Of course if the summary field is empty then there will be no summary . You can get round this by making the summary field a required field or outputting a summary field only if it is not empty...which may not be desirable in some cases. The code above has only 1 field; the summary field. The "url" bit will be grabbed for you automatically by PW. It is a property of the $page object, so called "Built-in Fields Reference". See the API docs. I suppose you are looking at some basic PHP tutorials? Depending on how comfortable you are at the moment, two of your best friends will be print_r ($exampleVariable); and var_dump ($exampleVariable); These will show you all the stuff within a $page object. I don't mean to be rude but I suggest you really dig into the PW default install as well as the "simpler" API documentation, i.e. selectors and variables ($page and $pages). Even if you have read them before, look at them again and again. That's what has been helping me. They are my constant companion. Try things out by example. For instance, in my tests site, I have a test page exclusively for testing variables and selectors. Of course you can use the selectors module but I do this to see things how they will really look like on a website. I hope this makes sense. Another suggestion I'd make is to take a simple working HTML page and convert that to PW. Along the way, document/annotate the logic you will use and why. For instance, what will be a field in a page and why? What will be pulled in from other pages? E.g. pull in the summary fields of the first 5 pages in the category articles, etc.1 point
-
PWired, I think what is being said here is that there is more to site rankings, SEO than writing lots and lots of articles. Of course, you can write lots of articles if you want...but it doesn't mean your site rankings will go up. There are a number of issues you raise here so maybe not good to get mixed up. Here's my take. Blog: You can easily create a blog in PW. This will come with all the ease of templating and powerful API that PW offers. Of course you can create one in WP too and none of us will be offended . Personally, I wouldn't create anything with WP..I've tried it before and don't want to go there again SEO/Site rankings: Whether a blog or some other sort of site, there are tips on how to improve your search rankings. Google these. Templating: There are a number of approaches. Key questions are these: Do I need lots of templates or few? How do I justify whether few or lots? The fewer the templates you can get away with the better for you, I think. By using PHP conditional statements (if's) with PW you can be as versatile as possible and use a few templates. How to organise your pages: Here I refer to the images questions. I'm sure you know that there are various approaches to this in PW. You can use Soma's image manager (in Alpha currently!); You can create one page to hold all your images. You can upload multiple images for each page. You can include inline images in the rich text editor (not all like this ). Which one you choose depends on your needs. Read more, etc...that's ridiculously easy in PW. Have you looked at the default PW installation? There are a number of ideas there. E.g. , the text before the read more can come from a description or summary text field. You click more it shows you the whole article. E.g. echo "<p>{$myarticle->summary}<a href='{$myarticle->url}'>Read more...</a></p>"; That will give you something like: I gotta run. I'll probably write more later. This reminds me, I really need to write that tutorial about how to approach templating... Hope this helps...1 point
-
Actually, @diogo, your proposal made a lot of sense, just saying. Doesn't sound like a very common need, but I don't see any harm in it either.. and it would definitely open a window for clean (and "codeless") customization of admin. Thumbs up for this.1 point
-
I didn't know this, but in CKEditor you can also paste the image. Just tried it, and worked1 point
-
Habemus papam! I've used the plugin that Wanze indicate me along with jquery validation and then sanitizing my input fields as Soma suggested. I'm on php validation now, I'm going to dig into the forum to find the right solution to make my form a bit safer to play with Thanks guys, you rock!1 point
-
Ok, there is no need to change the core for this. I created a small module that allows it for those that really want to do it. https://github.com/ocorreiododiogo/ProcessHomeAdmin1 point
-
to make the first page in the admin the one that appears by default. I was working on custom admin pages module, and occurred to me that PW could be flexible on this also. Although personally I really like the tree as the default view, I thinks it should be the responsibility of each one to decide about something like this.1 point
-
To add various events on the same day via Processwire and stored pages we have to edit our existing getEvents() function and we have to change the way we store events. According to my first example we stored events like this: Children of /calendar/ with date and event entry as our single calendar event. Now we change this way a little bit. We create calendar events by date and add children to this day. Something like this: /calendar/01-01-1970/deployunix6/ /calendar/ -> is our events container /01-01-1970/ -> is our day container /deployunix6/ -> one event at the 01-01-1970 This way we could avoid redundant information in our pagetree and easily maintain our calendar. In the next step we edit our getEvents() function. function getEvents(){ $days = wire('pages')->get("/calendar/")->children("sort=title"); foreach ($days as $day) { echo "'$day->title' : '"; $events = $day->children("sort=created"); foreach ($events as $event) { echo "<span><p>$event->title</p></span>"; } echo "', \n"; } }1 point