Query regarding $core_v2_ui.PageIndexQueryStringKey

Query regarding $core_v2_ui.PageIndexQueryStringKey

This question is answered

Hi,

I am using Telligent Community 6.x and in my custom widget I am displaying forum treads listing along with page number links.

How can I redirect to any of page from thread details from a Custom widget.

I have tried to do this by using $core_v2_ui.PageIndexQueryStringKey property, But PageIndexQueryStringKey I am getting is different than from thread details.

For example, In my ffull thread listing widget paging links are generated as http://localhost/f/5/t/3.aspx?pi104=2 and but in custom widget link has been generated as http://localhost/f/5/t/3.aspx?pi106=2.

Thanks.

Verified Answer
  • Hi,

    To make sure i haven't misunderstood, you would like to generate links for paged lists of content in a widget "B" from a separate widget, "A".    Unfortunately, there is not a supported way to do this as paged list query string keys are widget-specific to allow for multiple widgets on the same page to all page independently.  This is why one widget is returning its key as pi106 and another as pi104.  

    Potential workaround:

    Perhaps widget B could embed its $core_v2_ui.PageIndexQueryStringKey in a data attribute on a hidden html element.  Then some client script from widget A could read that value and build new URLs based on the current window.location to include include a querystring using widget A's key.  This would be somewhat fragile as it would require both widgets to exist on the page, but it could work.

    Hope this helps,

    Michael

All Replies
  • Hi,

    To make sure i haven't misunderstood, you would like to generate links for paged lists of content in a widget "B" from a separate widget, "A".    Unfortunately, there is not a supported way to do this as paged list query string keys are widget-specific to allow for multiple widgets on the same page to all page independently.  This is why one widget is returning its key as pi106 and another as pi104.  

    Potential workaround:

    Perhaps widget B could embed its $core_v2_ui.PageIndexQueryStringKey in a data attribute on a hidden html element.  Then some client script from widget A could read that value and build new URLs based on the current window.location to include include a querystring using widget A's key.  This would be somewhat fragile as it would require both widgets to exist on the page, but it could work.

    Hope this helps,

    Michael

  • Hi Michael,

    Just to clarify what we are trying to achieve. We want to display a paged list next to each thread list. This is to make the layout similar to our CS2008.5 version.

    This uses the control <CSForum:ThreadPostPageLinks runat="server" />

    What would be the equivalent in 6.1? Does this change your recommended approach.

    Thanks

    Dean

  • Hi Dean,

    Yes, I would still recommend the previous approach.  Starting with 6.0, widgets can all page independently, and therefore have independent paging keys.  Prior to this, if more than one widget on the page had pageable content, they would conflict.  

    However, this does mean that for multiple widgets to collaborate on the which page a given widget shows, they must communicate.  And widgets can only communicate between themselves on the client-side.  If it is necessary for the thread list to be paged from a separate custom widget, I would still recommend the approach of either generating these page links from the client side, or copying the pre-generated client-side links from the thread list widget and re-rendering them in the custom widget (also on the client-side).

    Thanks,

    Michael