Leaderboard
Popular Content
Showing content with the highest reputation on 08/23/2014 in all areas
-
So you've developed this shiny new website but your editors and marketing guys keep complaining they need more "native embedded content" with shiny share and retweet buttons because otherwise their text will look like ...text? Look no further: This processwire module has you covered! TextformatterOEmbed for processwire What it does At this point this module basically wraps the fabolous Essence PHP library by Félix Girault and adds some processwire magic to parse your boring Textareas and make your content look more bling blingthan ever before. Disclaimer: This Module is heavily inspired by TextFormatterVideoEmbed by the awesome guy who created processwire: RyanCramer. Requirements php 5.4+ curl and/or allow_fopen on Features Supports the following 32 providers out of the box (That's a lot of Hanna-Codes you can get rid of now, eh?): Add your own providers in the blink of an eye (if you're not good at regex - like me - it will propably take you a cup of coffee and a google search) Easy styling: Wraps embedded items with customizable BEM-Style classes including modifiers for every provider and embedtype. Choose to either add CSS directly in the modules configuration or to your existing stylesheets Choose to add pre defined Fluid Video CSS for your responsive design (or - again - feel free to add your own) Usage Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "oEmbed for processwire". Install the module Open the modules Settings page Add css classes either within the "Custom CSS" field or in a seperate CSS file. Every provider is wrapped with the following markup: <div class="pw-oembed pw-oembed--providername pw-oembed--embedtype"> <div class="pw-oembed__inner pw-oembed__inner--providername pw-oembed--embedtype"></div> </div> If you're not happy with the "block" class .pw-oembed you can rename it to something you like better using the modules config. Every embedded media item and it's respective inner wrapper has two modifier classes: One for the provider (i.e. youtube, twitter...) and one for the media type (one of photo, video, link or rich according to the OEmbed specification). This should be enough classes to add some fancy icons, adjust widths per provider or whatever else you like to do. If you're missing a provider don't hesitate to open a pull request (see roadmap first) and I'll do my best to add it as soon as possible. In the meantime you can extend the available providers found in lib/essence/providers.php in the modules settings using the following JSON-Format (remember that you'll have to properly escape the regex): [{ "23hq" : { "class" : "OEmbed", "filter" : "#23hq\\.com/.+/photo/.+#i", "endpoint" :"http://www.23hq.com/23/oembed?format=json&url=%s" } }] Roadmap Add moaaar providers:Facebook (currently not providing a "native" oEmbed API) Google Plus (currently not providing a "native" oEmbed API) support for more fancy integration of Instagram posts (currently there are "just" images without fancy sharing stuff that will be embedded) Render only one javascript (i.e. ) when there are multiple items of the same provider Propably make this module more generic and add services as submodules at some point World domination4 points
-
Page-Edit -> tab: Children -> Sort Settings -> Children are sorted by or: https://processwire.com/talk/topic/4758-release-pagetree-add-new-child-reverse-on-top/3 points
-
@adrian, thank you for your tip. Just submitted the above issue at GitHub.2 points
-
Thanks @jtherczeg. The best way to handle bugs (no matter how small) is probably by posting an issue at Github (rather than a PR). Thanks for spotting!2 points
-
new german updates for actual PW dev 2.4.14 (22 August 2014). Zip contains only updated/added files (in comparison to the default 2.4 lang pack). updated files: wire--modules--inputfield--inputfieldckeditor--inputfieldckeditor-module.json wire--modules--inputfield--inputfieldimage--inputfieldimage-module.json wire--modules--process--processfield--processfield-module.json pw-lang-de-dev-update.zip2 points
-
Yep $p = $pages->get(xxxx); $p->parent = $pages->get("/archive/"); $p->save(); But with that approach, you might find the Date Archiver module useful: http://modules.processwire.com/modules/process-date-archiver/1 point
-
@mvdesign: sorry, corrected my earlier post -- meant to say bootstrap use, not API use. The principle was correct, though; if I'm guessing right, you're bootstrapping ProcessWire, and thus output formatting is always disabled and file fields will always return arrays, regardless of output settings (including the "output single item if limit is one" setting).1 point
-
Ok, no need to use SQL here. Also not sure why you're foreach($languages as $language)? You can uncache the user and load it again via API, so it will load it fresh with language stored on user page. try{ $u = $session->login($username, $pass); if($u && $u->id){ $pages->uncache($user); // make sure it doesn't get user from cache $langID = $users->get($u->id)->language->id; // now load the user page $profileUrl = $pages->get(1003)->localUrl($langID); $session->redirect($profileUrl); } else { $loginError = "Login failed"; } } catch(Exception $e){ $loginError = $e->getMessage(); } I posted it in various login threads already, because all example login code posted in the forums has some flaws in that it doesn't catch errors when login failed multiple times (login throttle). To catch that you need to use a try catch method like in my example.1 point
-
thank you martijn, now as i found out about this cool feature i know what you mean! here is an explanation of how to do selects based on values of previous selects: https://processwire.com/talk/topic/5941-state-and-cities/?p=58161 sorry uprightbass360, little late and offtopic for your current problem...1 point
-
Bootstrap use, presumably? In that case output formatting is off and field value is returned in array format. You'll need to call wire('pages')->get($id)->file->first()->url etc.1 point
-
The language is set by what url you view a page.1 point
-
Probably the easiest way would be using Schedule Pages. If you need the unpublish date to be automatically set to x days after publish, you'll need to write a simple module to auto-populate the value of field 'publish_until'.1 point
-
Do you need them actually tagged somehow as expired, or could the selector in your template file just exclude all posts before a certain date? $pages->find("created<xxxx"); or perhaps from a custom published_date field, or whatever.1 point
-
@Martijn. I don't yet have experience with this sanitizer but it certainly could be very helpfull indeed in a later stage. Thanks for the link. I'm going to study it.1 point
-
I do think you know this, but ones all data is stored in PW pages, it's quite easy to loop them and update those pages (clean process). On every loop you do little steps. recent: In the dev there's now $sanitizer->purify this can be used for cleaning HTML.1 point
-
On my new development I now use this tree structure: Parentpage - countries childpage hold "country"-name childpage of country-name hold province-name childpage of province-name hold city-name country field, 1st select, for country value = normal parent select > "countries" province field, 2nd select, for province name OF country selected value = custom selector > "parent=page.country' city field, 3rth select, for city name OF province selected value = custom selector > "parent=page.province'. Works great!1 point
-
@BernhardB, look at the following structure: vehicles | +-- Cars | | | +-- Coupe | | | +-- SUV | | | +-- Crossover | +-- Bikes | | | +-- City bike | | | +-- Comfort bike | | | +-- Trekking bike | +-- Boats | +-- Canoes | +-- Rafts | +-- Yachts Say someone wants to search a SUV First <select> is Vehicles, that lists all vehicles: Cars, Bikes and Boats. When cars is selected, query all car type & present the user with a select with all types. When the user select a type, present the user with all found SUV's.1 point
-
A highly categorised site is a different beast then a textual 'animal' site. So what advanced is depends a lot from the context of your site. For a big news portal (mainly textual), I used the google search api to search the site. This way all textual content is searched, even in PDF,s. The results I get back from google (json) I store for 1 hour with markupCache to reduce requests to google. I use the urls from the results to get back to the page Objects. This way I let google do the search and ProcessWire the presentation of the results. ( showing thumbnails etc, headlines descriptions etc. ) But if you have a site with a lot of categories, highly structural. I could imagine you build a chain of selectboxes. This search is a Perfect fit for ProcessWire.1 point
-
Table Use this for tabular data, like rate tables or other things that you might typically represent in a spreadsheet. Use it for situations where you don't need the full-blown flexibility of repeaters, as it's technically more efficient with far less overhead than repeaters. Something like the Events Fieldtype could be very easily re-created via a Table field, but the potential uses are far broader. But for the most part, think tabular data when it comes to the Table field. Multipliers This is good for when you need a range of values (whether text, textarea, numbers, dates, etc.). If you are using repeaters with just one field in them, you might be a lot better off with a Multiplier. Like the Table field, Multipliers are very efficient and low overhead relative to something like Repeaters. Use Multipliers when you need to repeat a single input multiple times, optionally with a min and max number of inputs. Lets say you are building an employee directory, and each employee has between 1 and 3 email addresses. Rather than using 3 separate email fields, you would use 1 multiplier field and specify min=1 and max=3. Repeaters These are infinitely flexible in terms of what they represent, but each row of values is technically a page in the system. As a result, with the flexibility comes significant overhead. This is really only an issue when the quantity of repeater items gets high, or when you have lots (thousands) of pages using repeaters. I recommend repeaters for setting up things like homepage carousels. For example, if you go to the Villas of Distinction homepage, there are 3 separate repeaters in use on that page, each holding a photo, title, description, link. The client can have as many items in each of those sections as they want. Currently it looks like the first repeater as 6 items, the 2nd has 2, and the 3rd has 6. The possibilities of what can be represented with repeaters is endless, but look for potential alternatives when dealing with large quantities (whether large quantities of repeater items, or large quantities of pages using repeaters). PageTable This is one of the ProFields that is available for free (thanks to Avoine sponsorship) on the ProcessWire dev branch. Meaning, it'll be available for everyone to use as part of the core in ProcessWire 2.5. And you can use it now if you don't mind running the dev branch. PageTable has all the flexibility of repeaters, but with lower overhead from the admin/input perspective. Rather than trying to bundle all the inputs on one screen, PageTable shows you a table of items and you click on the item to edit it in a modal window. This enables it to be a lot more efficient from the admin UI perspective. It's also more flexible than repeaters are in terms of where you store your items. PageTable lets you choose where they should live, whether as children of the page being edited, or as children of some other parent page you designate. They might be a little more work to setup than repeaters, but I think that most situations where you need the flexibility of repeaters may be better served by PageTable. PageTable still can't compete with the speed and efficiency of Table or Multiplier, but consider using PageTable anywhere that you might have used Repeaters before. Repeaters and PageTable are fundamentally different from the admin UI/input perspective, so you'd want to compare them yourself to see what suits your individual input needs better. PageTable involves more clicking to create and edit items, making Repeaters potentially faster for entering data rapidly. But PageTable will scale much further in the admin UI than Repeaters will, so I would personally favor PageTable in more situations than Repeaters.1 point
-
Yeah, I thought about that. So, like I mentioned in my last post (before this one) I made it like this.... I have made my pages: root (skyscrapers) - provinces (parent) - - province (name of province) - - - municipal (name of municipal) In the templates for province and municipal, I just use the title fields now, but I am planning to include the map too. Then I renamed the following: root (skyscrapers) stays the same for now - cities > is now jobs - - city > is now company - - - item > is the same (I use it as function title) Eventually I will separate company - and link that to users... Item (the entry itself) is still using the skyscrapers template - where I just added the two fields province and municipal. Items are saved as: / Jobs / Company(name) / Title(function) And before saving it is required to select a value in both which are relational. This assures me also that items are separated in the tree from province and municipal. Working great. Maybe someone can benefit from this. I learn a lot from you guys, so I am happy with PW. The only thing I would like is to have a fixed width of the select box... have to look in that. The field 'municipal' was of course empty by default - producing just a little select button, maybe 5mm width - because no province was selected. Since the field municipal was related to province I could not use a normal default value to make this field become at least display something. The solution for this kinda field was pretty simple, in default value I just added "parent=page.province" (same as I mentioned in the post above).1 point
-
@bwakad It's simple.. if you think about it, your separate structure won't work cause it's not nested and thus parent=selected_parent. Isn't working there. You would maybe need some different selector then, but not possitive it's possible. You need to be able to make some connection like the parent > child.1 point