Forum Activity for @ken-rich

Ken Rich
@ken-rich
04/27/16 11:58:31AM
926 posts

User Defined Limit - Assign Variable From Form?


Design and Skin Customization

On my Combined Sales Module this works.

{jrCore_list module="jrVideo" profile_id=$item._profile_id search1="video_file_item_price > 0" order_by="video_display_order numerical_asc" limit="2"}

However, I want the profile owner to have control over the number of items displayed. So I added a text box with the form designer. The number inputted by the profile owner is available under $item as sales_videos_limit in the item_detail.tpl (shows in debug).

However, the limit function can't seem to utilize it and gives an error if I write:

{jrCore_list module="jrVideo" profile_id=$item._profile_id order_by="video_display_order numerical_asc" limit="sales_videos_limit"}

I thought it might be a syntax issue so I tried various combinations like.

limit="$item.sales_videos_limit"
limit="$item._sales_videos_limit"
limit="$_item._sales_videos_limit"
limit="_sales_videos_limit"

Nothing works so how can I assign a user-defined variable as the limit?
updated by @ken-rich: 07/30/16 11:43:52PM
Ken Rich
@ken-rich
04/25/16 06:55:20PM
926 posts

Share - Coding Question


Design and Skin Customization

Whoever built the "Service Shop" module appears to have attempted the same thing I am attempting.

However, their code doesn't work and will not work for my application either (for the same reason). A debug reveals that $_post._1 is not available to the irem_index.tpl

{if isset($_post._1) && strlen($_post._1) > 0}{$_post._1}{else}
Show Whatever You Want As Default{/if}

Can someone smarter than me come up with a code that will work?

So it will need to be:

{if (a item has been posted) display it at the module URL, on (iframed or listed) the item_index, or in lieu of it (url reassigned from index to detail)} (else} display whatever You Want{/if}

updated by @ken-rich: 04/25/16 06:57:17PM
Ken Rich
@ken-rich
04/23/16 04:52:54PM
926 posts

Share - Coding Question


Design and Skin Customization

This concerns the "Combined Sales" module I built with Aparna.

If I share the module URL to Facebook, I get the same picture and description as if I share my profile (bio/profile pic). It doesn't use the data available in the form update/create fields of the module.

However, if i share a detail page created by the module, I get the correct data, as provided by the form create/update (see attached).

My question is, how do I get that data to be shared with the module URL http://kenrich.me/sales instead of http://kenrich.me/sales/27 (or whatever item number the profile ends up with after numerous creations/deletions/creations).

On my profile 27 is the current item_id and /sales/27 is the uri There is only one item allowed to be created by the module as the whole point is to produce one page URL for promotions that has all saleable items listed or linked.

It seems to me, there should be a way to make it so that the simplest URL, the module URL which is profile/sales carries the right share information.

When I do a debug to the detail page that shares properly I see the URL's under $post

$_post}
Array (6)
_uri => "/sales/27"
module_url => "ken-rich"
module => ""
option => "sales"
_1 => "27"
_profile_id => "1175"

The data for OG info is there under $item. This is what's missing from the item_index.tpl

sales_image => ""
sales_image_name => "Ken's Sales.png"
sales_title => "Ken's Store"
sales_text => "This is a store with products and services from Ken Rich. An ebook, CD, video..."

I'm thinking (maybe I'm nuts) that there are 3 possible scenarios to achieve the desired result (proper sharing at the module URL profile/sales).

1) Perhaps the tab and url for the module can be linked to the detail page instead of the item_index.tpl and then what is displayed and shared by the module URL (profile/sales) would be the detail page (already sharing properly).

2) Or keep the Sales tab (and module URL) linked to the item_index.tpl but alter the share tpl to use the data from the form designer create/update available at $item of the uri_1 instead of the module url.

3) Or this is something that requires modifications at the PHP level of the module and scenario 1 and 2 are not viable paths.


Capture333.JPG.jpg Capture333.JPG.jpg - 43KB

updated by @ken-rich: 07/28/16 07:59:04AM
Ken Rich
@ken-rich
04/23/16 03:27:57PM
926 posts

Profile Specific Listing - Coding Question


Design and Skin Customization

Hi Michael,

I saw your edit after I solved it - lol.

I did the debug and saw that it was under $ post and $ item. I chose $item.

Knowing nothing about coding conventions I initially tried it as :
profile_id=$item_profile_id
but that didn't work. Then I tried
profile_id=$item.profile_id
which DID work but when I saw your edit I revised to
profile_id=$item._profile_id

I'm still not clear as to why this was not necessary on the item_index.tpl or how one is supposed to know when a . instead of a _ is necessary, but at least I'm able to achieve the desired outcome on this particular issue. Thanks.
Ken Rich
@ken-rich
04/23/16 12:26:00AM
926 posts

Profile Specific Listing - Coding Question


Design and Skin Customization

On the list page it comes back:
$_profile_id: 1175
$_post.p :          

On the detail page:
$_profile_id: 
$_post.p :          

I don't really see how that is helpful to me though. I had already inferred that the list.tpl was listing items specific to my profile and the detail.tpl was listing for all profiles.

My problem is, I don't know how to make the item_detail.tpl page behave like the item_list.tpl page, in terms of only listing items specific to the profile.

Is that something determined in the php for the module, or can a change to the code I'm using in the template produce the desired result? That is, a change to this code:

{jrCore_list module="jrStore" profile_id=$_profile_id order_by="product_display_order numerical_asc" pagebreak="4" page=$_post.p pager=true}

I've looked at all the list variables in the documentation and if there is a way - I'm not seeing it. Or perhaps I am staring right at it but not comprehending.
Ken Rich
@ken-rich
04/22/16 01:33:13PM
926 posts

Profile Specific Listing - Coding Question


Design and Skin Customization

I created a new module with Aparna.

If I place this code on the item_list.tpl page it lists only the products owned by the profile. If I place it on the item_detail.tpl page it lists all the products for the whole network.

I don't understand why and want to know how to rewrite it so that only the products owned by the profile are listed when the code is installed on a detail page.

  {jrCore_list module="jrStore" profile_id=$_profile_id order_by="product_display_order numerical_asc" pagebreak="4" page=$_post.p pager=true}


updated by @ken-rich: 07/25/16 01:47:07AM
Ken Rich
@ken-rich
04/19/16 04:29:19PM
926 posts

Services Module Question


Design and Skin Customization

Yes, the "Service Shop" module.

I'm trying to standardize all of my sales modules so that there is a text area providing a short description for listing and share info. Then a separate but fully capable editor to supplement the detail page.
Ken Rich
@ken-rich
04/19/16 02:22:03PM
926 posts

Services Module Question


Design and Skin Customization

I wanted to add an editor to the form but there doesn't appear to be a Form Designer button.

Is that module set up differently or something? How would one alter the form?
updated by @ken-rich: 08/02/16 04:11:33PM
Ken Rich
@ken-rich
04/09/16 09:31:26AM
926 posts

User Tip - "Embed Saleable Files"


Design and Skin Customization

An example is here - http://kenrich.me/page/227/in-defense-of-contemporary-christian-music

The ability to have saleable products comes from Foxycart, so this assumes you are using that module. Otherwise, your files can't have a price set, a buy button, and can only embed as a free download.

If you have Foxycart and have set a price for your file, the embed code is still the same as default. What changes is that your saleable file embed now has a buy button and link back to the detail page (instead of having dead links for the title and icon and no buy button).

So if you are using an editor and the "Embed Local Media" tool, it will embed using the same code it always generated. If it was already embedded, now it will look and function properly.

If you want to embed a file manually, change XX to the file's ID # and it looks like
[jrEmbed module="jrFile" id="XX"]
You can find it's ID in the datastore.

You won't need to know the ID number if you are using the editor because the file name will be listed (see attached screenshot). The code is generated for you.
Captureoo.JPG.jpg Captureoo.JPG.jpg - 50KB
Ken Rich
@ken-rich
04/04/16 01:16:54PM
926 posts

How to limit the number of items a user can create?


Jamroom Developers

Awesome - how did I overlook that?

I would prefer to hide the button but I just tested and this solution will certainly serve the purpose.

Thanks Douglas.
  14