logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
sales17944678  
#1 Posted : Wednesday, July 3, 2019 2:46:41 PM(UTC)
sales17944678

Rank: Newbie

Groups: Developers, Registered, HelpDesk
Joined: 6/20/2019(UTC)
Posts: 3

Thanks: 1 times
Seeking to create 400+ products each with unique html content. Tried HTML Snippet widget, but that seems best suited for repeatable shared content, and I would have to create 400+ of them . I have to assume that Webpage Content widget is closer to my task, but once placed, will not allow for editing, and there is no documentation that I can find to guide me, so in absence of other data it appears to not be working.

Edited by moderator Monday, July 8, 2019 1:57:39 PM(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

MikeR  
#2 Posted : Wednesday, July 3, 2019 4:19:59 PM(UTC)
MikeR

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, System, Admin
Joined: 10/18/2018(UTC)
Posts: 183

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
Hello,

Why is the product description or the more details not suitable for the task?

Please explain your goals and we can provide some assistance.
Thank you for your support!
Mike Randolph
AbleCommerce.com
sales17944678  
#3 Posted : Wednesday, July 3, 2019 4:36:26 PM(UTC)
sales17944678

Rank: Newbie

Groups: Developers, Registered, HelpDesk
Joined: 6/20/2019(UTC)
Posts: 3

Thanks: 1 times
99 percent of my hosted site on AC7 is free content, with dynamically built using nVelocity scripts from data sourced from the Product Template fields. Until I have the documentation in hand to build dynamically using AC9, am seeking tools to build the pages statically using whatever HTML editors given.

Examples:

http://store.redeeminglo...-Pfundsteinfont-P59.aspx

http://store.redeeminglo...lores-Fluddfont-P92.aspx

Here are two versions of rare content for sale in AC7 dynamic build, and AC9 static build using HTML Snippets:

http://store.redeeminglo...e-Praisersfont-P146.aspx

http://cmsdemo.ablecomme...terbach-and-the-Praisers



What is the word on Webpage widget functionality? What documentation exists?
MikeR  
#4 Posted : Friday, July 5, 2019 8:54:00 AM(UTC)
MikeR

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, System, Admin
Joined: 10/18/2018(UTC)
Posts: 183

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
Hello,

The webpage widget is setup to be embedded into a webpage, we had not thought about embedding a webpage into a product. It would need a new attribute webpageid in order to do what you are wanting.
Thank you for your support!
Mike Randolph
AbleCommerce.com
judy at Web2Market  
#5 Posted : Monday, July 8, 2019 7:10:42 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Can you use Razor syntax on the product page? For example, some code that was converted from AC5 vb code to use on _BuyProductDialog.cshtml. This is the best I could come up with without having to add code to cause site to recompile and with little documentation. It seems using Razor syntax could paralell what you would do in nVelocity.
Quote:

@model BuyProductDialogModel
@using CommerceBuilder.Products
@{
RequireScript("~/scripts/option_picker.js");
RequireScript("~/scripts/jquery-easing/jquery.easing.min.js");
RequireScript("~/scripts/custom/buy-product-dialog.js");
//jme 061319 custom from AC5 site
Product product = AbleContext.Container.Resolve<IProductRepository>().Load(Model.Product.Id);
string description = product.Description;
string extendedDescription = product.ExtendedDescription;
string mainStyle = "";
string mainKeywords = "";

string leftPart = "";
string rightPart = "";
int i = 0;
if (extendedDescription!=null && extendedDescription.Length > 0)
{

string[] parts = extendedDescription.Split("||".ToCharArray());

while (i < parts.Length-1)
{
leftPart = parts[i];
rightPart = "";
i = i += 1;
if(i<=parts.Length)
{
rightPart = parts[i+1];
}
if (leftPart == "webtext")
{
extendedDescription = rightPart;
}
else if (leftPart=="style")
{
mainStyle = rightPart;
}
else if(leftPart=="keywords")
{
mainKeywords = rightPart;
}
i = i += 1;

}

}

Later on, a couple of the variables are used.
Quote:

<span>@Html.Raw(mainStyle) @Html.Raw(description)</span>


Possibly something like the following:-last line is existing AC code I left in so you could see how to nest it
Quote:

if (product.TemplateFields.Count > 0)
{
foreach (ProductTemplateField tf in product.TemplateFields)
{

if (tf.InputField.Name == "xx")
{
<span>@Html.Raw(tf.InputValue)</span>
}
}
}

if (Model.ShowProductReviews && AbleContext.Current.Store.Settings.ProductReviewEnabled != CommerceBuilder.Users.UserAuthFilter.None)

thanks 1 user thanked judy at Web2Market for this useful post.
sales17944678 on 8/9/2019(UTC)
sales17944678  
#6 Posted : Friday, August 9, 2019 5:50:59 PM(UTC)
sales17944678

Rank: Newbie

Groups: Developers, Registered, HelpDesk
Joined: 6/20/2019(UTC)
Posts: 3

Thanks: 1 times
Thanks to judy13846, spent the last month getting up to speed on ASPNET and RAZOR, tools I have not used before now.

Although I cannot actually run the demo code (all Macs, no place to run SQL server), I was able to study the example files and simulate a TemplateFields collection. I have determined that the following code will handle the template fields as I require, placed into the _ProductPage.cshtml file:

First, adding the reference to the top:



@using CommerceBuilder.Products



and then strategically placing the following logic (stripped of most of the html tags for clarity here):



Product product = AbleContext.Container.Resolve<IProductRepository>().Load(Model.Product.Id);
@{
var aCnt = 0;
var mCnt = 0;
var CRight = "";

if (Model.tif.Count > 0)
{

{
foreach (ProductTemplateField tf in product.TemplateFields)
{
if (@aCnt == 0)
{
CRight = tf.InputValue;
aCnt++;
mCnt = 0;
}
else
{
if (@mCnt == 0)
{
<b>Label</b><B>@tf.InputValue</B><br />
}
if (@mCnt == 1)
{
<b>Audio</b><B>@tf.InputValue</B>
}

if (@mCnt == 2 && @tf.InputValue != "")
{
<b>Video</b><B>@tf.InputValue</B>
}
if (@mCnt == 3 && @tf.InputValue != "")
{
<b>Embed</b><B>@tf.InputValue</B>
}
mCnt++;
if (@mCnt == 4)
{
<br /><br />
mCnt = 0;
}
}
}


}
}
<h3>Copyright @CRight</h3>
}




Worked perfectly in my VS tests, using dynamic array as standin for PRoduct object, fields collection.
Will check with Mike to see if I can get this added to a page in my most recent demo site.

Thanks again for the guidance.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.