Jump to content

Alessio Dal Bianco

Members
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Alessio Dal Bianco

  1. Hi all! I have created this new module that improve the current search engine on PW: https://github.com/USSliberty/Processwire-site-indexer (Beta version) The main idea is to create an hidden field that store keywords (separated by space). The keywords are generated automatically from all text fields in the page, plus PDFs and DOCs files. So if you create new text fields you can forget to add they on Search Page Module. The only thing to do after install, is to change the list of fields in Search Page (see attachment). In fact you need to search only in "indexer" field. NOTE 1: At this time the module index only when you save the page. In the next week maybe i will add the complete-site re-index. NOTE 2: The files are indexed with 2 Unix packages (poppler-utils & wv). I have tried without success with pure PHP classes, but if know a class that works fine i can add it into module. ADB
  2. I think that Processwire can fit nearly everything . But how many shops must manage the web-app ? I think that the problem is to manage the usage and the syncronization with the server when the shop is temporary offline... USSliberty
  3. Hi Guys!, When i'm developing some Modules usually i use the Admin interface for try/adjusting the configuration of all the objects ( Templates, Field, Pages ). So at the end i need to use the ProcessWire API for create each of those objects... and it is difficult (for me) to translate all on code, because some Fields/Templates can have a particular configuration and sometimes i really don't remember all the names of the parameters It will be useful (maybe) to have a button to export all in PHP code to copy/paste in the Module. USSliberty
  4. Hi bcartier! If you go to Modules > Page search in the admin, there are the default search configurations. USSliberty
  5. Hi onjegolders, Very interesting topic! I work for a web agency since 2009 and i also made some tiny sites alone, but only now i'm quite secure that i can build all types of site. Some years before i was very afraid/insecure when the clients asked me something different from a basic site. What i can suggest is to begin from search a web agency where you can learn while you make money . When i started where i'm now, i learned in a year more than 2 times of what i learned at University! I'm very lucky because the web agency where i'm employed is very open-mind and full of new project, so i learn every day. In my own opinion, if you start to build, alone, without clients, and you have only small projects ( 500€/1000€ more or less 400/800 pounds )... Well it's hardly. Obviously without the bureaucratic of manage a company although small ( in Italy is a sucide! ). I hope i helped you in some ways!
  6. Hi there! I have discovered PW in the middle of my desperate searching for a Plone substitute (our official CMS). In fact i tried all major CMS such as Drupal, Joomla, Wordpress and recently i have put an eye to Concrete5 but... No way, all of those have something that make me feel "uncomfortable": • Drupal: dozen and dozen of plugin for every small thing!, messy admin area ecc. • joomla!: I used it about 5 years ago and it makes a lot of assumption on your HTML.... And i haven't noticed anything regards custom fields in recent versions... • Wordpress: Is born for Blogs, and if you must make something more evolute than a Blog is real pain. • Concrete5: I watched the videos and it seems make a lot of assumption on HTML. Processwire is the real candidate for supersede Plone though there is some functionalities that must be developed and tested very well. Anyway keep up the great work! USSliberty PS: This graph is interesting http://www.google.com/trends/explore#q=drupal%2C%20wordpress%2C%20joomla%2C%20plone&cmpt=q
  7. Hi Teppo, Thanks for all suggestions! Anyway this attribute: $template_obj->filename Returns me an absolute path, that's why i must do a string replace In the next few days nights i will complete the basic functionalities ! USSliberty
  8. Ok with "$page_temp->editable()" works fine. $is_preview = $this->input->get->view && $page_temp->editable(); Thanks Soma!
  9. Maybe i was not clear... but the hook *must* be executed every request. The view change is permanent after page save... The GET variable "view" is only for test the view without change it on the database; that's why i need to check in the hook if the user is logged or not. Anyway i have resolved this little glitch in this way: /** * Initialize the module * We add the hook to "loaded" event of a page. * So we have the current template file name * * Also we add The Tab "Visualization" and we show the list of voiews. */ public function init() { // I save the result of permission test, prior to hook, in a private variable... // that i check after in the hook. $this->has_perms = $this->user->hasPermission('page-edit'); $this->addHookAfter('Page::loaded', $this, 'changeView'); }
  10. Thank you Soma for the guidelines! I have adjusted the code in this way and all works like expected... There is only one little error here: /* NOTICE: where the user is not logged this line return me an error: 2012-12-09 11:19:00 guest http://localhost/?/ Error Call to a member function has() on a non-object (line 50 of /Users/alessiowork/Progetti/luciavenezia.com/www2/wire/core/Role.php) */ $is_preview = $this->input->get->view && $this->user->hasPermission('page-edit'); // ------------------------------- It is not real problem because we don't want to let anyone to change the view, but "$this->user->hasPermission('page-edit')" doesn't should return false ? <?php /** * Views for ProcessWire * * Every Template in ProcessWire have a file associated named in this way: * <templateName>.php * * The aim of this module is to extend the number of files associated of * a specific Template. * * For example: if the template name is "page", the file associated is page.php. * With Views we can have others visualization of the same Template named in this way: * <view_name1>-page.php * <view_name2>-page.php * | * | * | * <view_nameN>-page.php */ class Views extends Wire implements Module{ /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Views', 'version' => 90, 'summary' => 'Add the selection of the view of a specific page', 'href' => '', 'singular' => true, 'autoload' => true, ); } /** * Initialize the module * We add the hook to "loaded" event of a page. * So we have the current template file name * * Also we add The Tab "Visualization" and we show the list of voiews. */ public function init() { $this->addHookAfter('Page::loaded', $this, 'changeView'); } public function changeView($event){ $page_temp = $event->object; // Avoid change view for admin if("admin" == $page_temp->template) return; // ------------------------------- // We check if there is the GET parameter "view" set. // example: http://example.com/great-page/?view=fullscreen // and also we check if the current user have the right permission to // view the page. /* NOTICE: where the user is not logged this line return me an error: 2012-12-09 11:19:00 guest http://localhost/?/ Error Call to a member function has() on a non-object (line 50 of /Users/alessiowork/Progetti/luciavenezia.com/www2/wire/core/Role.php) */ $is_preview = $this->input->get->view && $this->user->hasPermission('page-edit'); // ------------------------------- if( $page_temp->view || $is_preview ): $view = $is_preview ? $this->sanitizer->name($this->input->get->view) : $page_temp->get("view"); // if is specificated the view "default" in the preview, // for example : http://example.com/great-page/?view=default ... // ... we force to use the default template file. if( $view == "default" && $is_preview ) return; $templateName = (string) $page_temp->template; // We pick the template name... $template_obj = &$page_temp->template; // ...and the template object associated. // ------------ // Now we change the template file to the one we choose. $template_obj->filename = str_replace($templateName, $view . "-" . $templateName, $template_obj->filename); // ------------ endif; } public function ___execute(){ // TODO } public function ___getSelectableViews($event){ // TODO } public function ___install(){ // TODO } } USSliberty
  11. Hi all! I have just created a proof-of-concept Module here: https://github.com/U...ocesswire-views. The main idea was started by me in this topic: http://processwire.c...age/#entry21257 The aim of this module is to extend the number of files associated of a specific Template. For example: if the template name is "page", the file associated is "page.php". With Views we can have others visualization of the same Template named in this way: view_name1-page.php view_name2-page.php | | | view_nameN-page.php Also you can test your view (useful when developing...) in this way: example: http://example.com/great-page/?view=fullscreen where "fullscreen" is the name of the view. IMPORTANT: Since i'm still learning how to make modules, the module works with a TextField called "view" (where is stored the name of the view), and you must create it manually. Maybe in the next few days i will make the automatic creation of the field and some other functionalities. Any Feedback is appreciated! USSliberty
  12. Yep! It's true (and sometimes i did it), but.... the urlSegment is write somewhere in the code. Is only a matter of flexibility . I see that PW can do, more or less, everything! Maybe at this point i will try to do a module for this!
  13. Ehm... maybe the example i made was unlucky I will try a different approach to explain my problem. We made this site some months ago: http://aou.udine.it This site have only a few of Content Types (aka Templates in PW), and the most used Content Type is "Page". The Page is used everywhere in the site in many different ways: The News List http://aou.udine.it/notizie A generic page http://aou.udine.it/azienda/chi-siamo ecc... So those views have very different HTML but the Content Type is the same. But the key example is here: http://aou.udine.it/innovazione/accreditamenti Here there are all the subpages of the current page, if i click for example "Joint commission international" the content of those pages is displayed. Well, this is a customized view because the default view is this : http://aou.udine.it/innovazione/accreditamenti/folder_listing And the publisher decide where to use this view. I know that i can create another Template in PW inheriting the fields of another, but the object is basically the same. I know also that i can create a field that i check in the php file, but it is not well scalable and i mix real data with something regards of visualization. Thanks all for patience!
  14. Ok, Thank you all for responses! Anyway I was looking for something that not makes me write more code for change visualization. A will make an Example with Plone, ( the CMS i want to supersede with PW ): • Every Content Type have a customizable list of visualizations that correspond a template file. for example:( Page with 3 columns, 2 columns and so on...) • The user change, via interface, the visualization of that page. The difference is that the CMS include the right file, without create another custom field or urlSegments that i must check with PHP. I hope i have explain better!
  15. For the developer is quite easy in this way But for clients there should be an interface with a list of available visualizations (defined by developer) for the current template ....
  16. Hi all, I know that every template has its file associated for rendering the page. But i wonder if i can change file in a page that require a different visualization without create another template. Is that possbile ? ADB
  17. Hi Ryan, have you still got the version 1 of ProcessWire ? I want to check if i can adapt the FCKeditor module for PW2... Personally I really don't like TinyMCE and i want to replace it with CKeditor.. If i could Anyway thanks for the great work! Now i'm working on the first site with ProcessWire and it is very powerful! Soon i will make a post with my first experience with PW. ADB
  18. Hi all! Here it is the first draft of the italian translation of processWire 2.2. All files should be translated, but for clarity, below there are all the files translated. Core /wire/core/Fieldtype.php Inputfield Modules /wire/modules/Inputfield/InputfieldEmail.module /wire/modules/Inputfield/InputfieldFile/InputfieldFile.module /wire/modules/Inputfield/InputfieldImage/InputfieldImage.module /wire/modules/Inputfield/InputfieldPageListSelect/InputfieldPageListSelect.module /wire/modules/Inputfield/InputfieldPageName/InputfieldPageName.module /wire/modules/Inputfield/InputfieldPassword.module /wire/modules/Inputfield/InputfieldSubmit/InputfieldSubmit.module /wire/modules/Inputfield/InputfieldTinyMCE/InputfieldTinyMCE.module /wire/modules/Inputfield/InputfieldURL.module /wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module Markup Modules /wire/modules/Markup/MarkupPageFields.module Language Support Modules /wire/modules/LanguageSupport/LanguageSupport.module Process Modules /wire/modules/Process/ProcessForgotPassword.module /wire/modules/Process/ProcessLogin/ProcessLogin.module /wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module /wire/modules/Process/ProcessPageClone.module /wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module /wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module /wire/modules/Process/ProcessPageEditLink/ProcessPageEditLink.module /wire/modules/Process/ProcessPageList/ProcessPageList.module /wire/modules/Process/ProcessPageSearch/ProcessPageSearch.module /wire/modules/Process/ProcessPageSort.module /wire/modules/Process/ProcessPageType/ProcessPageType.module /wire/modules/Process/ProcessProfile/ProcessProfile.module /wire/modules/Process/ProcessField/ProcessField.module /wire/modules/Process/ProcessHome.module /wire/modules/Process/ProcessList.module /wire/modules/Process/ProcessModule/ProcessModule.module /wire/modules/Process/ProcessPageTrash.module /wire/modules/Process/ProcessPageView.module /wire/modules/Process/ProcessPermission/ProcessPermission.module /wire/modules/Process/ProcessRole/ProcessRole.module /wire/modules/Process/ProcessTemplate/ProcessTemplate.module /wire/modules/Process/ProcessUser/ProcessUser.module Admin Theme /wire/templates-admin/default.php ================== I will check with more attention the quality of translation in the week-en! If you want to contribute, this is the Github repo: https://github.com/U...ian-processwire Cheers, Alessio
×
×
  • Create New...