Kentico新手求助:自定义Page Type内容无法在评测页显示
Hey Denis, let's work through the most common fixes for this frustrating issue—since your database has the data but your product review page is still blank, here's a step-by-step breakdown of what to check:
Troubleshooting Kentico Page Type Content Not Displaying
1. Confirm Page Type & Page Status
- First, double-check that your custom product review Page Type is actually assigned to the page you're testing. Head to the page's properties in Kentico Admin, open the "Page Type" tab, and verify it's set to your custom type (not a default one like "Basic page").
- Make sure the page is published, not just saved. Unpublished pages won't render any front-end content, even if the data exists in the database.
2. Audit Your Template/Page Builder Setup
- If you're using a custom ASCX template, ensure you've added code to render each field:
- For text fields (name, type, roast), use
<%# Eval("YourFieldName") %>(replaceYourFieldNamewith the exact internal name of your field, e.g.,ProductName). - For images, use Kentico's built-in image control to handle paths correctly:
<cms:CMSImage runat="server" ImageUrl='<%# Eval("ProductImage") %>' />
- For text fields (name, type, roast), use
- If you're using the Page Builder, don't just add the Page Type to the page—you need to add widgets that map to your Page Type fields. Drag a "Text" widget and set its content source to your
ProductNamefield, repeat for other fields, and add an "Image" widget linked to your image field.
3. Check Field Permissions & Visibility
- Go to Page Types > Your Product Review Type > Fields in the admin. For each field:
- Ensure it's marked as Visible in editing form (hidden fields can sometimes fail to render on the front end, even if they're stored in the DB).
- Verify the Permissions tab allows the "Public" role (or whatever front-end role your visitors use) to "Read" the field. Restricted permissions will block content from being displayed.
4. Validate Data Context in Custom Code
- If you're pulling data programmatically, make sure you're fetching the current page's data correctly. For example, in Kentico 12 MVC, you'd use:
Avoid hardcoding document IDs or paths—always rely on the current page context to get the associated data.var currentProduct = DocumentHelper.GetDocument<ProductReviewType>(Context.CurrentDocument);
5. Clear Kentico Caches
- Kentico caches content heavily, and stale caches can prevent new data from showing up. Head to System > Cache > Clear cache in the admin, then reload your page.
- Also, check if the page has output caching enabled (in page properties > "Caching" tab)—disable it temporarily to rule out cached blank content.
6. Use Kentico's Debug Tools
- Enable Debug Mode (System > Settings > Debug) to see error messages directly in the page source.
- Check the Event Log (System > Event log) for any warnings or errors related to your Page Type or page rendering—this often reveals issues like missing field mappings or permission errors.
- Use the Page Inspector (click the "Page Inspector" button on your page in the admin) to confirm if your Page Type fields are being loaded in the page context.
If none of these steps work, feel free to share more details about your Kentico version (e.g., 12 MVC, 13 Portal Engine) and how you're rendering the page, and we can dive deeper!
内容的提问来源于stack exchange,提问作者Denis
相关产品推荐
相关产品推荐

