Recent content by kirsty

  1. kirsty

    XF 2.2 Conditional Template Extension?

    Have a look at the forum_view and forum_view_type_article templates. The article one extends the forum_view one so it can do most of the same stuff but change some parts to show the information differently. (Oh, I also found that the extensionparent bit is lurking there in the article template...
  2. kirsty

    XF 2.2 Conditional Template Extension?

    Thanks! It looks like <xf:extensionparent /> is exactly what I'm looking for!
  3. kirsty

    XF 2.2 Conditional Template Extension?

    I've got template_a with an extension in it <xf:extension name='extension_name'> original stuff </xf:extension> and then I extend that in template_b <xf:extends template='template_a'> <xf:extension name='extension_name'> replacement stuff </xf:extension> which works fine. But...
  4. kirsty

    XF 2.2 Setting a checkbox custom field value

    Ah, makes sense. Thread\Creator was what I needed. And then you just need to set the field using 'is_imported' => 'imported'. Thanks!
  5. kirsty

    XF 2.2 Setting a checkbox custom field value

    I have a custom field which, when I tick the checkbox on the thread manually, appears in the xf_thread_field_value table with field_id is_imported field_value a:1:{s:8:"imported";s:8:"imported";} If I set the value of this custom field in code using 'is_imported' =>...
  6. kirsty

    XF 2.2 Passing attributes to a class widget?

    I kept digging and eventually got it sussed. You need to pass in the attribute with a context- prefix and then you can get at it in the render method without the prefix. E.g. in the template <xf:widget class="Blah\Widget\TestWidget" context-stuff="my stuff in here"/> and in the widget's...
  7. kirsty

    XF 2.2 Passing attributes to a class widget?

    I can define a widget in a template using <xf:widget class="Blah\Widget\TestWidget" /> but although I'm told this... I can't figure out the right syntax to provide the options. I've tried various variations on passing in paramName='paramValue' in the xf:widget tag (e.g. params="['abc']" is...
  8. kirsty

    XF 2.2 actionAddReply seems to return error prematurely?

    Getting my localhost instance running on my current code was (happily) less trouble than I thought it would be! My problem seems to be that in Forum/actionPostThread my error gets caught and returned by the $creator->validate($errors) call, whereas in Thread/actionAddReply the error isn't being...
  9. kirsty

    XF 2.2 actionAddReply seems to return error prematurely?

    Thanks. I'm adding my own error in setupThreadReply $thread->error('duplicate thing in post', 'loquax_error', $isDuplicate); and that's the error I'm seeing in the browser. If I don't add that error then I don't see an error from XF, and I just get a normal reply, so I don't think any other...
  10. kirsty

    XF 2.2 Change thread titles

    I do something like this in my overridden setupThreadCreate method to change my title to one combining a couple of custom fields (I've removed the title field from the template in the relevant forums) protected function setupThreadCreate(\XF\Entity\Forum $forum) { $creator =...
  11. kirsty

    XF 2.2 actionAddReply seems to return error prematurely?

    I've got some code in my addon that extends Pub/Controller/Forum and intercepts the reply from actionPostThread to change a certain error reply (which I create in setupThreadCreate) into a view where the error can be corrected by the user. That all works fine. I'm trying to do the same thing in...
  12. kirsty

    XF 2.2 Missing templates restoring a blank forum?

    I've been looping through developing our XF forum using the workflow from https://xenforo.com/community/threads/importing-guidelines.25325/ and I've been round this [set things up, backup a clean db, import, restore the clean db loop] several times without a problem. This time I've come to...
  13. kirsty

    XF 2.2 Accessing forum pages from outside forum directory

    Thanks, I appreciate the reply which gives me something to go and work on! I'll go and investigate getting the REQUEST_URI sorted out correctly if that's what's needed. We actually have nginx and Apache together somehow, but I'm not sure how the setup works as I've pretty much ignored the...
  14. kirsty

    XF 2.2 Accessing forum pages from outside forum directory

    Thanks, that's helpful to know i'm at least heading down a reasonable path. At the moment I'm looking at the var dump from xf and seeing that both have the exact same xf->request->server->REDIRECT_URL in them, though of course they have different REQUEST_URI values as one stays with the page I...
Top Bottom