Jump to content

Community

snugRugBug

+Clients
  • Posts

    167
  • Joined

  • Last visited

1 Follower

About snugRugBug

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

snugRugBug's Achievements

Community Regular

Community Regular (7/13)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

24

Reputation

  1. Thanks @Nathan Explosion. I guess I will have to debug the old-fashioned way.
  2. In IPS 4.1.9 the following feature was added (source) : This does not currently seem to be working on my site. I'm getting a 500 error on my homepage on my site, and I'm not seeing this debug output. I'm running IPS 4.1.10, and I'm an administrator, so I don't see why this wouldn't work. Is there a setting where I can configure this feature?
  3. We want to build a text filter into our listing tables. By this I mean a text box where the user can type in text, and then the table only displays records/categories where the entered text is a substring of the title of a record/category. A basic version of this was easy to implement using just JQuery, but I can't find a way to search through results that are not displayed due to pagination, using only javascript. Let me know if there is a way to make the javascript-only solution work. I found that the type of filter I'm trying to implement was in use in the AdminCP of my site (example: in the members area you can search/filter members by display name) , so I went and looked how it worked. It turns out that the tables with the filter built in comes from the PHP class \IPS\Helpers\Table\Custom, while the default listing template is passed an \IPS\Helpers\Table\Content object. So I'm actually looking for a way to use the \IPS\Helpers\Table\Custom class instead of the \IPS\Helpers\Table\Content class. It would probably be possible to create an instance of the \IPS\Helpers\Table\Custom class on the template itself, but there is no way to prevent the initial \IPS\Helpers\Table\Content object from being passed into that template. If I created a \IPS\Helpers\Table\Custom object in the template, it would be very inefficient. I know that the actual creation of the involved \IPS\Helpers\Table\Content object happens within a controller in the \IPS\cms code, and I'm not sure if there is a way to override just that method. So now I would like to know: Is there a way to change what is being passed into that template?
  4. Anybody? I basically just need to be able to determine if I'm on record or category level.
  5. I've created a block that shows popular records for a certain database. Now I want that block to NOT display when the user is viewing a record. So I would like to add logic that hides the block if we are on a record page. Usually, I would just use the dispatcher like this: {{$dispatcher = \IPS\cms\Databases\Dispatcher::i();}} {{if !$dispatcher->recordId}} {{/* block content here */}} {{endif}} The problem is that the dispatcher does not reflect the page the user is currently seeing. On a page were a user sees a record, the a dump of the dispatcher from within the block looks like this: Object(IPS\cms\Databases\Dispatcher)#106 (9) { ["controllerLocation"]=> string(5) "front" ["databaseId"]=> int(6) ["categoryId"]=> NULL ["recordId"]=> NULL ["url"]=> NULL ["module"]=> NULL ["output"]=> NULL ["classname":protected]=> NULL ["dispatcherController"]=> NULL } One would expect the category and record id to be set, but they aren't. Also, calling \IPS\Request::i() isn't much use: object(IPS\Request)#4 (3) { ["cookie"]=> array(7) { ["IPSSessionFront"]=> string(32) "1234567890123456789012345678901" ["IPSSessionAdmin"]=> string(32) "1234567890123456789012345678901" ["acpTabs"]=> string(93) "{"core":[],"community":[],"members":[],"nexus":[],"content":[],"stats":[],"customization":[]}" ["hasJS"]=> string(4) "true" ["member_id"]=> string(1) "1" ["pass_hash"]=> string(32) "fc725df66df9a155b5d1b5079071781f" ["ipsTimezone"]=> string(19) "Africa/Johannesburg" } ["_url":protected]=> object(IPS\Http\Url)#6 (5) { ["url":protected]=> string(201) "http://mysite.com/index.php?app=cms&module=pages&controller=builder&do=getBlock&blockID=app_cms_Blocks_acbupkzwu&pageID=5&orientation=vertical&csrfKey=1234567890123456789012345678901" ["data"]=> array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(28) "mysite.com" ["path"]=> string(10) "/index.php" ["query"]=> string(155) "app=cms&module=pages&controller=builder&do=getBlock&blockID=app_cms_Blocks_acbupkzwu&pageID=5&orientation=vertical&csrfKey=1234567890123456789012345678901" } ["queryString"]=> array(8) { ["app"]=> string(3) "cms" ["module"]=> string(5) "pages" ["controller"]=> string(7) "builder" ["do"]=> string(8) "getBlock" ["blockID"]=> string(24) "app_cms_Blocks_acbupkzwu" ["pageID"]=> string(1) "5" ["orientation"]=> string(8) "vertical" ["csrfKey"]=> string(32) "1234567890123456789012345678901" } ["isInternal"]=> bool(true) ["isFriendly"]=> bool(false) } ["data":protected]=> array(8) { ["app"]=> string(3) "cms" ["module"]=> string(5) "pages" ["controller"]=> string(7) "builder" ["do"]=> string(8) "getBlock" ["blockID"]=> string(24) "app_cms_Blocks_acbupkzwu" ["pageID"]=> string(1) "5" ["orientation"]=> string(8) "vertical" ["csrfKey"]=> string(32) "1234567890123456789012345678901" } } Any way to get the correct dispatcher/request object?
  6. Since I originally installed the site, my account has all the admin privileges. If I add a new admin user, however, they are still quite limited in their privileges. One example of such a limitation is the new admin user's inability to edit database fields. I have taken a look at the Admin group settings, and I found nothing strange there. Does anyone know how to debug this?
  7. ah, very good, although there is no info on while loops. One liners work: {{while ($statement->fetch()) { var_dump($exactMatchQuery); } }}
  8. I was trying to look up why my while loop wasn't working in a template, so I came looking for the 'template logic' documentation page. Turns out it does not exist anymore, even though it's still linked from the 'template tags' page. Here is the URL where the 'template logic' documentation is supposed to be: link
  9. Another thing that REALLY gets me down is the inability to search in custom fields. It feels like it eliminates 50% of the point of even having custom fields. I've looked into modifying the existing search engine to include custom fields, but it seems like a really difficult task. I've also asked IPS if they plan to improve this, and they said they don't know.
  10. @opentype I'm packaging this functionality as part of an application, so to expect users to make this specific change to their field is far from ideal. I'm thinking it would be better if this were addressed by IPS, since it does not seem like intended behavior. I will post a bug report. Thanks for the info, though. Bug report:
  11. For anyone else wondering about this, the fix to get around this is the following: {{$images = $record->customFieldDisplayByKey('images', 'raw');}} {{if isset( $images[0] ) && "".$images[0] === "".\IPS\File::get( 'cms_Records', "" )->url }} {{unset($images[0]);}} {{endif}}
×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy