Jump to content

kongondo

PW-Moderators
  • Posts

    7,529
  • Joined

  • Last visited

  • Days Won

    160

Everything posted by kongondo

  1. Andrew, Place that code in your template file and I can promise you it will run... . It is just JavaScript; nothing special about it. If I have the time I will prepare a demo with your code and demonstrate this. What k07n wrote above was just an example about including flash in your site.
  2. OK, my Russian is getting better and better From this site: http://blog.deconcept.com/swfobject/#expressinstall You could place expressInstall.swf and the swfobject.js in your site/assets/ folder. You can then include them in your template file using PW API....You can then paste your JavaScript code above inside the template file. PW template files will accept HTML, CSS, JS, PHP..etc....Try this and let us know... Other refs: https://github.com/swfobject/swfobject https://code.google.com/p/swfobject/ - how to use documentation
  3. Nice one guys @Diogo...thanks for the reminder about user templates being editable. I usually forget that... Btw, you are missing the closing ")" in your selectors' code
  4. Quick one...will update later...(will check for errors) - Tested with PW Dev (version from a couple of days back) Trash Pages get(); - will NOT get anything from the Trash get("include=hidden"); - will NOT get pages in the Trash (even if their status there is hidden). get("include=all"); - will get ALL pages in the Trash (all pages - visible, hidden, published, unpublished) Tree Pages (non-admin) get(); Unpublished + Hidden Page => will return something like "for-page-1532" if you echo out the name of the returned document. Echoing title returns the name normally (not the title). get("include=hidden"); Unpublished + Hidden Page => will return something like "for-page-1532" if you echo out the name of the returned document. Echoing title returns the normal name (i.e. without the "for-page-1532"). get("include=all"); Unpublished + Hidden Page => will return page. Echoing out the name behaves normally (i.e. without the "for-page-id"). get (); Published + Hidden Page => will return page normally. get (); Unpublished + Visible Page => will return page normally. You can use has_parent in your selector Edit: Yes, you can use parent!=$config->trashPageID in your selector as well .
  5. +Teppo.... +Ryan's code is really well-commented and written
  6. Peter, You can easily exclude pages in the trash by using, for example, has_parent!=7. The ID of the trash page is 7 by default...OR...example code from Trashman (the module) if ($page->parent->id != $this->config->trashPageID) { //blah blah}//used in function/method context $config->trashPageID returns the Page ID of the trash page. Pages sent to the Trash have their parents changed to the Trash page (ID=7). They don't become orphan or lost pages Edited: Added Trashman code example
  7. Like Arjen said, $pages->get("gallery") will not get you anything; you will get an unknown selector operator since PW doesn't know what gallery is Lots of "get" examples here: http://processwire.com/api/variables/pages/ http://processwire.com/api/variables/page/
  8. Welcome hop_along_kid! You are going to enjoy this ride I can promise you that
  9. I have a feeling PW date selectors will obey stuff you can throw at PHP strtotime
  10. The rest are in Soma's head The guy knows everything . Jokes aside, I think they are buried deep in PW code. I recall Soma saying when he was getting started he studied module code and looked in PW modules, etc. Edit: Adding hopefully relevant links to collate date selector stuff in one place.. http://processwire.com/talk/topic/3290-sort-by-date-range/ http://processwire.com/talk/topic/2795-selector-with-dates-and-checkboxes/ http://processwire.com/talk/topic/2260-search-articles/ - Nice one! See post by Ryan
  11. Browser caching issue then? What happens in Safari only, does the re-ordering stick? What about in the DB, do things change there?
  12. Hehe. Am trying to help Andrew here....Andrew, you are for real, no?
  13. I am having difficulty following you. Do you want to create a site in which some pages will have flash content and others not? Yes, you can do that in PW. PW does not generate your mark-up though. You would have to code your flash scripts which you can add to the template file for those pages that need the flash content. I haven't coded flash for many years so don't even know how I would go about that . See this thread for ideas. Are you new to PW? If you are, have you read the docs? They are super helpful
  14. You position could be right,...ESC delete!...Kyle will enlighten us....
  15. I think this is where the confusion arises. I am assuming Kyle means "ADs for User 1, etc"...according to their City, but your example suggests "ADs by User 1, etc". Question is, who is posting the ADs?; these Users or others?
  16. Aaah, I forgot the user bit. Thanks Diogo...However, the ADs belong to the City and I think they should be together. In addition, I don't think the City is associated with the user. I think it is the other way round. The user is associated with the City. If the user is no longer registered, the City remains . Would it not be possible to restrict users to their Cities using the City template (access rights)? This way, we only have one instance of each AD but this can be accessed by multiple users. In your example, are those ADs repeating for each user? I would create users using normal PW access model. Maybe I am not reading this properly.
  17. Kyle, If an AD can only belong to one City and one Category, then I would probably do it like below (almost similar to what you have...). Cities would be parents of ADs. Categories would be children of Category... City 1 AD 1 - C1 AD 2 - C1 City 2 AD 1 - C2 AD 2 - C2 AD 3 - C2 AD 4 - C2 City 3 AD 1 - C3 AD 2 - C3 Category Electronics Furniture Books This will keep my setup DRY. I do not have to repeat categories like you have in your example. ADs will have Single Page Reference Fields. I would restrict selection in this field to just children of Category (electronics, etc.). Cities will have a "cities" template with minimal fields. ADs an "ads" template with all the necessary AD fields + a Single Page Reference Field to select one category. Categories would have "categories" template probably with just a title. Searching: Written quickly, there could be errors, etc //find all ads of a city. 1007 is the ID of the city; you can use path or name of the city as well $ads = $pages->get(1007)->children("sort=title, limit=50"); //find all ads of a city that belong to electronics category. "category" is the name of the single page reference field. "electronics" is the name (title works as well I think?) of the category page $elecronicAds = $pages->get(1007)->children("sort=title, limit=50, category=electronics"); //find all ads belonging to electronics irrespective of city $elecronicAds = $pages->find("category=electronics, limit=50"); //find all ads and sort them by city, then category $allAds = $pages->find("template=ads, sort=parent, sort=category, limit=50"); There's probably better ways of doing this + you have other selectors at your disposal, but this should give you an idea
  18. @Kyle, The principle is the same. Basic questions to ask yourself: Can an Ad belong to more than one type (e.g. electronic, furniture, etc.) Can an Ad apply to more than one City? Remember, page fields give you access to ALL information about pages selected via the page field...e.g. $page->selected_single_page_field_name->title will give you the title of the page currently selected in that page field (here, single page reference field type)...You can do this for other fields belonging to the selected page, can iterate its other fields, etc.
  19. Spam? ..apologies to OP if it ain't This is how Google translates the above... with CSS understood well how to insert a Flash site at all wanted to do at MODX not completed PW decided to change my mind but do not quite understand what's what's website need to insert a flash on the main page without the other hxttp://xxxxxxxxxxxxx/ FLASH hxttp://xxxxxxxxxxxxxx
  20. Minor niggle - you are using a phone icon for contact us. After clicking that, I was expecting to see a phone number only (or online calling). Instead, I see phone numbers, email, etc on the actual page. Not a big deal..
  21. You are welcome. I've updated my post with a link to the docs...
  22. @cstevensjr I get what you are saying about different situations but of course you can still search for hidden and unpublished items by using "include=hidden" or "include=all" in your selectors. You can also use $pages->get to get one page, hidden or not. . I suppose it's about using what best suits the situation.. @Horst - the above code was definitely not a waste of time!
  23. @Adrian, You've been posting some really nice stuff - code and this module. Would you be able to put these stuff on Github and Gist so we can easily locate (and fork ) them and follow their development and perhaps contribute to? Many thanks.
  24. You might want to use PW online installer if FTP is slow - http://processwire.com/talk/topic/3602-pw-online-installer-download-of-latest-pw-install-to-server/ You never have to touch anything inside the wire folder
×
×
  • Create New...