Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted May 28, 20168 yr Hi there, Would it be possible please to add an option to the topic feed widget that allows me to display topics that have specific tags attached to them? At present this option is not available and in my opinion it really should be. For a possible use case - the European Championships are coming up and I would like to showcase the threads that have the tag "euro2016" attached to the topic. Thanks
July 2, 20177 yr i have solved with a pages php block but is not same thing /* \IPS\Content\_Widget::buildWhere OR find for tag_text OR \IPS\Content\_Controller::getSimilarContent for search along content router */ $class = 'IPS\forums\Topic'; $where = []; $tags = ['home']; $container = ['201','203']; /* Container */ if ( isset( $class::$containerNodeClass ) ) { $where[] = array( \IPS\Db::i()->in( $class::$databaseTable . '.' . $class::$databasePrefix . $class::$databaseColumnMap['container'], $container ) ); } /* Tags */ $tagWhere = array(); $binds = array( $class::$application, $class::$module ); foreach( $tags as $tag ) { $tagWhere[] = "( tag_text LIKE CONCAT( ?, '%') )"; $binds[] = $tag; } $where[] = array( $class::$databaseColumnId . ' IN (?)', \IPS\Db::i()->select( 'tag_meta_id', 'core_tags', array( array_merge( array( 'tag_meta_app=? AND tag_meta_area=? AND (' . implode( ' OR ', $tagWhere ) . ')' ), $binds ) ) ) ); $table = new IPS\Helpers\Table\Content( $class, \IPS\Http\Url::external( \IPS\Http\Url::baseUrl().ltrim($_SERVER['PHP_SELF'],'/') ), $where, NULL, \IPS\Content\Hideable::FILTER_AUTOMATIC, 'read', FALSE ); $table->limit = 9; //.......... print table;
Archived
This topic is now archived and is closed to further replies.