Via Typoscript I want to handle a reaction form with ajax. I have configured the page with the Typoscript code shown below.
But I keep getting the Typo3 error that the page is not configured?
1294587217: The page is not configured! [type=15191][]. This means that there is no TypoScript object of type PAGE with typeNum=15191 configured.
ajaxComments = PAGE
ajaxComments {
typeNum = 15191
config.tx_realurl_enable = 0
config.disableAllHeaderCode = 1
config.disablePrefixComment = 1
config.metaCharset = UTF-8
config.no_cache = 1
config.additionalHeaders = Content-type:application/json
10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = backend
extensionName = extName
controller = Main
vendorName = venName
action = sendComment
switchableControllerActions {
Main{
1 = sendComment
}
}
settings =< plugin.tx_extName.settings
persistence =< plugin.tx_extName.persistence
view =< plugin.tx_extName.view
}
}
Related
In older projects (< TYPO3 7.6) I was using the following code to load a page with a pagenum:
ajax = PAGE
ajax {
typeNum = 2008
10 < styles.content.get
10.stdWrap.innerWrap >
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/json
disablePrefixComment = 1
xhtml_cleaning = 0
admPanel = 0
debug = 0
no_cache = 1
}
}
Now we're working with TYPO3 8.7 and Fluidcontent and when using this code, a blank page is being outputted, no content. I had a look into the Object-Browser and it seems that styles.content.get should still work.
I'm afraid it doesn't work anymore because of Fluidcontent and the different structure for backend layouts. Unfortunately, I could not find anything helpful on Google. Does anybody know how to use this (load page via pagenum) with Fluidcontent in TYPO3 8.7?
styles.content.get is defined very late with fluidcontent. so your copy might copy an up to then undefined/ empty definition.
either use the reference operator =<,
define it by your own:
.
styles.content.get = CONTENT
styles.content.get {
table = tt_content
select {
orderBy = sorting
where = colPos=0
}
}
or use this immediately:
.
ajax {
10 = CONTENT
10 {
table = tt_content
select {
orderBy = sorting
where = colPos=0
}
}
}
I have a ckEditor with uploadimage on my VF page. I have configured it as
config.extraPlugins = 'uploadimage';
config.imageUploadUrl = 'apex/SiteFileUploaderBackup';
I am yet to fully develop the SiteFileUploaderBackup page and the controller. Just tried with a dummy code.
This is my VF page :
<apex:page sidebar="false" showHeader="false" controller="SiteFileUploadControllerbackup">
<script>
function getUrlParam(paramName){
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i') ;
var match = window.location.search.match(reParam) ;
return (match && match.length > 1) ? match[1] : '' ;
}
var funcNum = getUrlParam('CKEditorFuncNum');
console.log('*** funcNum=' + funcNum);
var str = '{"fileName":"kingston-visitor-chair-black-med.jpg","uploaded":1,"error":{"number":201,"message":"A file with the same name already exists. The uploaded file was renamed to \u0022kingston-visitor-chair-black-med(3).jpg\u0022."},"url":"https:\/\/cadence--cos2--c.cs14.content.force.com\/servlet\/servlet.ImageServer?id=015c00000003hQm&oid=00Dc0000003w9jE&lastMod=1511435219000"}';
if(funcNum == null)
window.opener.CKEDITOR.tools.callFunction(funcNum,str);
else
window.opener.CKEDITOR.tools.callFunction('{!funcNumber}', str );
window.close() ;
</script>
And the controller just has the constructor
public class SiteFileUploadControllerbackup {
public String funcNumber {get; set;}
public SiteFileUploadControllerBackup()
{
string ckEditorFunc = ApexPages.currentPage().getParameters().get('CKEditorFuncNum');
if(funcNumber == null)
funcNumber = ckEditorFunc;
}
}
Since this is a stub code I am just looking for correct ResponseText which should be the json I used in VF page. However I am always getting
Error code: filetools-response-error. and the responseText contains the entire HTML of the VF page.
I searched a lot but could not find any sample VF -apex code which can help. Any help on how to get the json in responseText would be appreciated.
I have an extension which adds a custom content element called "Products".
I'm trying to make an ajax pagination. When I try to get the products list with styles.content.get, the products are rendered correctly, but when I'm using the extbase way, I get no products.
The custom page type:
ajaxProductList = PAGE
ajaxProductList {
typeNum = 6
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:text/html
}
# WORKING
10 < styles.content.get
10.where = CType='products_main'
# NOT WORKING
10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = Products
pluginName = Main
vendorName = Vendor
}
}
Any idea why?
EDIT:
Adding the storagePid manually under vendorName fixes the issue, but is there any way this could be considered automatically?
persistence.storagePid = 116
i am working on simple hotel reservation system that users enter their info, like hotel or room. in every page i have footer bar that show feedback of system when user do something. for example when user add hotel , after doing this,when he redirect to any pages, in footer bar, immediately, display , "hotel added successfully".
|----------------------------------------|
| |
| GridView |
| |
| |
|----------------------------------------|
|hotel added successfully ! |
|----------------------------------------|
the solution that i am using is :
when users log something , i log it
and i define div[id=notification] in shared/_layout, and using a worker to call a function that check log database and get new ones.
// i use worker to repeatedly invoke function to check db
var worker = new Worker('../Scripts/worker.js');
worker.addEventListener('message', function (e)
{
if (e.data != "")
{
var result = e.data;
var results = result.split("##");
if ($("#notificationID").val() != results[1])
{
$("#notificationID").val(results[1]);
}
}
}, false);
and the function to check db is
public string GetNewTrans()
{
string userName = Membership.GetUser().UserName;
using (var context = new jobEntities())
{
var query = from p in context.Logs where p.UserName==userName && p.IsNew == null orderby p.ID_Log descending select p;
if (query.Count() > 0)
{
var log = query.FirstOrDefault();
DateTime c= DateTime.Parse(log.RefreshDate.ToString());
var sec = DateTime.Now.Subtract(c).Seconds;
if( sec> 2)
{
log.IsNew = "false";
context.SaveChanges();
}
var result = log.Section + " : " + log.Action +"##"+log.Success.ToString()+"##"+log.ID_Log.ToString();
return result;
}
return null;
}
}
now i think that when number of users increase , the load of check db increase and cause to make pages slower.
so do you have any better solution ?
and my framework in asp mvc 3.5 and use EF 4.1
The better solution to get some data from db its using JsonResult action controller to get json data and than modified on the client.
As for info messages you can add TempData["message"] object in your controller and in redirecting View
probably a noob question but I am not sure what is going on. Here is the function from the controller...
function product ($product_id = NULL)
{
if ($this->input->post())
{
$pcs = array();
$pcs[] = $this->input->post('product_id');
$pcs[] = $this->input->post('styles');
$build = implode('-', $pcs);
redirect('seatcovers/configure/'.$build);
}
elseif ($this->_checkID('id','products',$product_id))
{
$data['product'] = $this->model_products->getProductRow($product_id);
$data['styles'] = $this->model_products->getStyles($product_id);
$data['images'] = $this->model_products->getImages($product_id);
$tags['title'] = 'title';
$this->load->view($this->session->userdata('language').'/includes/view_header',$tags);
$this->load->view($this->session->userdata('language').'/products/view_product',$data);
$this->load->view($this->session->userdata('language').'/includes/view_footer');
}
else {
redirect('seatcovers');
}
}
Not sure what I'm doing wrong? Does caching not work when their is a form?
Yes, caching is done on URI level means, when a URL is cached in Codeigniter then it will display the cached page and will not execute your controller.