Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. Still, it's a good idea to rename it to .php if it will be in a not protected folder. Never to much to remind
  2. Not if you include it with php... in this case, (.js) wouldn't be any different from (.inc)
  3. Ok, if the js file stays in the assets folder, you really should do this...
  4. well, you can... just put <?include(yourfile.js);?> between <script> tags
  5. Your code looks longer mainly because your variables and field names are also very long. The same code looks shorter like this: $settings = $pages->get(123); $sname = $settings->simple_name; echo $sname; You can put all your variables on "settings.inc" file, for instance, and include it on the "head.inc" file, or whichever file that you know will be included by all the templates. EDIT: changed get('name=site-settings') to get(123) to make it even shorter
  6. I don't use Mac, so I can't help you here. Let's wait that MAMP users appear
  7. Must be the permissions. Give maximum permissions recursively to all the folder to see if it works, and then adjust them to the required ones. If you need help for doing it on mac, check here http://support.apple.com/kb/HT2963 EDIT: And welcome to the forum
  8. Hm... I think the writing style should be free
  9. This is great, raydale!
  10. It's great that people are coming with modules like this, but the reason PW is so flexible, is because it's so easy to build your own snippets of code to achieve this kind of things. I have mixed feelings concerning the modules, and tend to prefer the idea of the snippets repository...
  11. As I understand, you want to apply the color to emphasize those lines. I think it would be best to do it with css. So, just make those lines "Italic" on the text area, and colour them with css, based on the class of that article: article.category1 em {color:'blue'}; article.category2 em {color:'red'}; article.category3 em {color:'green'}; article.category4 em {color:'yellow'}; EDIT: or choose "bold", or "underline" instead... but i would say that em is more semantic in this case
  12. Hey, no problem at all! Don't hit yourself mate
  13. Have a look here: http://processwire.com/talk/topic/364-failed-test-for-json-support/
  14. In this case, would even be better to have a page and a template (not connected with a file) only with the fields for the sidebar, and call them from building_block_a.inc.php like this: $pages-> get(123)->name_of_field where 123 is the id of the sidebar page
  15. I think there is a limit, so the website doesn't accept an infinite number of different urls for the same page. EDIT: I thought I should explain this better. You should have the segments under control so you can prevent the URL to accept anything that is thrown at it. So, it makes all the sense to have the limit. Also pay attention to what is advised when allowing the segments:
  16. Adam, I think we just answered at the same time... don't be so harsh on yourself
  17. On Robert's code, I count 18 characters less if you do
  18. Ya, I know! But if the server doesn't support <?, it won't support <?= neither... So, what I'm saying is: if you are going to use <?= in one statement, why not use <? in all the others also? Or, if you are concerned that the server doesn't support them, don't use neither. EDIT: Or am I wrong here? I thought they where both shorthands
  19. Robert, I noticed that you used shorthand syntax on only one place of your template <?= $page->rootParent->title; ?> I would change that to the complete syntax, just in case the server doesn't support the previous. Or, since in PHP 5.4, the shorthand syntax will always be activated, I would change all the others to <? include "blocks/htmlhead.inc"; ?>
  20. diogo

    PHP 5.4

    Sounds great but they aren't planning to ship it with ubuntu 12.04
  21. You're completely free to do it the way you want. Check this post where people discuss other ways of organizing templates and where Ryan explains why this is the chosen form for the default install http://processwire.com/talk/topic/740-a-different-way-of-using-templates-delegate-approach/page__fromsearch__1
  22. I meant, replacing wire('pages')->get(1187)->url for $wire->pages->get(1187)->url But I thought you where bootstrapping PW by including the index file. In this case, maybe you can add some parameters to the function, and put those calls there.
  23. Should work... did you try also with $wire->pages?
  24. I'm not on my computer, so I can't test it. No screenshots?
  25. It works great Ryan! I'm in love with this new feature! Repeated fields and field-template context, used in the right amount, are extremely powerful for creating a friendly edit environment. I really think this brings PW to a new dimension
×
×
  • Create New...