enricob
Members-
Posts
23 -
Joined
-
Last visited
Profile Information
-
Gender
Male
-
Location
Treviso, Italy
Recent Profile Visitors
3,100 profile views
enricob's Achievements
Jr. Member (3/6)
15
Reputation
-
Files are compiled twice / Translatable strings are not translated
enricob replied to Zeka's topic in Getting Started
Hi, I confirm there is an issue with strings not translated in files included using relative path (I am using Processwire 3.0.62): the strings are not translated in frontend even if I have inserted the translations in the backend. I solved it using absolute path to include the files, so instead of using: include './views/_home.php'; I used: include $config->paths->templates . 'views/_home.php'; -
enricob started following are there better fields naming convention? , Site with millions of „pages” , How can I get the user profile language? and 5 others
-
Very impressive @nickie, could you please share which is the site with more than 2 milions of pages?
-
How can I get the user profile language?
enricob replied to enricob's topic in Multi-Language Support
Thanks Soma, you're a genius!!! You're solution does not only work perfectly but it's also elegant and clean -
How can I get the user profile language?
enricob replied to enricob's topic in Multi-Language Support
Thanks Soma, that's what I though... But if you check the value of the language field of the current user object while he's viewing the site (not by querying the $user object, but for example looking at the database) you'll see that the value never change when the user change the navigation language, while $user->language value does. So, if $user->language give me the current navigation language (that changes at runtime) how do I get the language value of the current user though the api? -
How can I get the user profile language?
enricob replied to enricob's topic in Multi-Language Support
Maybe I am not explained myself clearly but the fact is that the variable $user->language->name changes, reflecting the language I switched to on the frontend. But when I look at the profile of the same user on the admin panel the language has not changed...Even if I look directly at the database I see that the language field of the page user (for the user I am viewing the site with) stays the same, even if I am switching the language on the frontend. I think the point here is that Processwire automatically populate the variable $user->language with the currently active language, in some way overriding the actual language associated with that user. In fact if I do the same query to get an user (but not the user I am logged in), the value of $userObject->language is exactly what I expect. -
Hi all, I know I can get the current user navigation language using this query: $currentUser = $pages->get("template=user, id=".$user->id); $currentUserLanguage = $currentUser->language->name; or directly: $currentUserLanguage = $user->language->name; Now, if I am viewing the site with this user and change navigation language using the language switcher the value of $userLanguage changes accordingly. However, the REAL user language as seen in the user profile on the admin panel doesn't change. So, my question is: how can I get the user profile language as set in the user profile? Thank you!
-
Great solution Adrian, thank you very much!!! Didn't know about the existence of FieldtypeTemplates... The support in this community is unbeatable!
-
Hi all, I am trying to create a page field type that let the user choose a field among the list of the all the fields (to clarify: the list of fields under Setup > Fields), but I cannot make it work. I tried this: I created the field, I set the type to "Page", I went to Input tab and changed the attribute "Parent of selectable page (s)" : here I select "Home > Admin > Setup > Fields". The problem is if I go to the page the new field is there but the dropdown is empty, there are not values in it. Why? Is it because core pages like templates or fields are hidden by default? Any help is appreciated. Thank you!
-
Hi all, this is a site we have just released, the first we have done using ProcessWire: http://www.ht-heizelemente.de Here's the modules that we used: - AIOM: very useful to minify and concatenate script and css - Alternative Grid Images: good to have image gallery with custom image dimensions - MarkupSitemapXml: simple but effective module that outputs a sitemap.xml As you can see, we didn't use a lot of modules simply because PW is so powerful we didn't have the need to use many of them... I have to say I am very happy with this cms, thanks to ryan and other developers (and the community too) for this great product!
- 1 reply
-
- 4
-
Hi, first I have to say I really like this module, thanks blad! The only minor complaint I have is: when I resize the images to be quite small (200px or less) the longer image names go on two lines so the boxes that contain these images become higher than others, and this breaks the grid layout... Looking at the html code, one way to solve the problem could be to set a fixed height to the header of the boxes (InputfieldItemHeader class), so for now i simply added this code to the module css and now it works: ul.InputfieldFileList li .InputfieldFileInfo { height:80px; } Obviously it's not a perfect solution since I will lose this modification on module update... Maybe if this is useful to others the modification could be done on the original module code
-
Hi all, I use Wappalizer extension a lot and many times I found a new cms or a tool just because I saw the icon on the browser bar. I think that having Processwire on Wappalizer could help in gaining it popularity (of course, mostly among developers or technicians). Like some of you said is not so easy to identify if a site is using PW, one can certainly hide the fact that is using it, anyway I think most of the sites that use PW has the metatag "generator" so this could be a good way to identify PW on a site. I think using the generator metatag should be considered a good practice, at least without indicating the version for security reason...obviously anyone should be free to remove it. What do you guys think? If we had to add PW to Wappalizer here's the link: https://wappalyzer.com/suggestions (I think this should be done by an expert since you have to specify the criteria for identify PW, and I only know about the generator metatag)
-
Insert a paragraph inside a form built using API
enricob replied to enricob's topic in API & Templates
Thank you adrian!!! I did take a look at /wire/modules but I was expecting something like InputFieldHtml or InputFieldParagraph or something like that Anyway I am too interested in what LostKobrakai asked...How can I exclude a field from being included in the wrapper element? Or can I at least customize the class of the wrapper element for a specific field? -
Hi all, I am building a page that contains a quite complex request form. To do this, I created a page based on a "contact-form" template, and inside this template I put all the code needed to display the form and manage the results. The form is built using PW API, the code is inspired from some examples I found here on the forum. My problem is that I don't know how to insert a text paragraph between the fields, anyone has idea on how to do this? Here's a very simplified version of my code (only two fields displayed), in this case I would like to append a custom paragraph (simple html) between Company and Name fields. The only solution I found is to use an additional field of Fieldset type, without content, and on the label I set the text I need to output. However in the label field I am not able to insert html tags... Any help is very appreciated... Thank you! // create a text input $field = $modules->get("InputfieldText"); $field->label = "Company"; $field->attr('id+name','company'); $field->required = 1; $form_fields[] = $field; // create a text input $field = $modules->get("InputfieldText"); $field->label = "Name"; $field->attr('id+name','name'); $field->required = 1; $form_fields[] = $field; // submit button $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","Send"); $submit->attr("id+name","submit2"); $submit->skipLabel = '4'; // create the form field (also field wrapper) $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'contact-form'); foreach ($form_fields as $field) { $form->append($field); } $form->append($submit); // append the form in $out variable $out .= $form->render();
-
@argos I know the fact that "everything is a page" can be weird at the beginning (it takes me a few hours of experimenting to get confortable with this concept ), but I can confirm for my experience that this is really a great solution, both from a developer and and from a customer point of view, better than any other cms I tried (and I tried many, Wordpress, Joomla, Drupal, ...) I started to love the idea when I was starting to solve some problems in PW, and I always ended up (even after a lot of time thinking) saying "well I just have to use pages!". Just to give some examples: Problem: put some settings on a site level that can be manageable from the customer, ie a common footer text, a common image banner, and so on. Solution: You just have to create a new Settings template, put some fields in it, create a page with this template, fill in the fields and you're done! Problem: Create a categories system Solution: You create a category template, with the field you need (title, image, ...), you create some pages that uses these template, then, to link a category to a page, you only have to define a Page type field for the template that this page uses, fill in the value, and you're done! In both cases (in fact almost all other cases) from the template files (php) you can get the field values very easily using the api. The fact is: once you understand the "page" concept, you can solve almost any problem you can think of, and even very quickly.
-
A different way of using templates / delegate approach
enricob replied to Soma's topic in API & Templates
Thank you @Soma, in fact I have still a lot to learn about PW! You're right your solution would work, I haven't thought about it... Anyway, even if I like the idea of having a single main.php template file, I have to say that I too have come to the conclusion that ryan's approach feels better, it's just more "ProcessWire" style (and there's good reason for this! )