Jump to content

Search the Community

Showing results for tags 'fieldtypemulti'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 2 results

  1. I'm developing a multi value fieldtype and there's this method called getLoadQueryAutojoin(). // FieldtypeMulti.php /** * Return the query used for Autojoining this field (if different from getLoadQuery) or NULL if autojoin not allowed. * * @param Field $field * @param DatabaseQuerySelect $query * @return DatabaseQuerySelect|NULL * */ public function getLoadQueryAutojoin(Field $field, DatabaseQuerySelect $query) { if($this->get('useOrderByCols')) { // autojoin is not used if sorting or pagination is active $orderByCols = $field->get('orderByCols'); if(count($orderByCols) > 0) return null; } $table = $this->database->escapeTable($field->table); $schema = $this->trimDatabaseSchema($this->getDatabaseSchema($field)); $fieldName = $this->database->escapeCol($field->name); $separator = self::multiValueSeparator; foreach($schema as $key => $unused) { $query->select("GROUP_CONCAT($table.$key SEPARATOR '$separator') AS `{$fieldName}__$key`"); // QA } return $query; } Why would someone need to autojoin a field, or not need a autojoin? Any benefits/drawbacks? I havent used the feature it at all in my 3+ years PW experience. I'm not sure whether I need to implement it but I am leaning towards returning null and disable it altogether.
  2. As part of the webmention module I am working on, I want to detect if the page being viewed has the "Webmentions" field and if so, add a Link: header. I have hooked before PageRender::renderPage to add the header and that works OK. I am having trouble checking for the Webmentions Fieldtype, though. FieldtypeWebmentions extends FieldtypeMulti and is empty on new pages. My code below does not work because the $field->type is returning NULL when the Webmentions field is empty. When the Webmentions field is not null, then it returns the Fieldtype as expected. How can I reliably check if a page's template has a specific Fieldtype, whether the field is empty or not? Am I missing something in the Fieldtype or Inputfield classes for the module? Thanks for any help! private function findFieldtypeWebmentions(Page $page) { # loop: each field for this page foreach ( $page->fields as $field ) { if ( $field->type instanceof FieldtypeWebmentions ) { $this->webmention_field = $field; return TRUE; } } # end loop return FALSE; } # end method findFieldtypeWebmentions()
×
×
  • Create New...