TYPO3 (v9.5) News extension load with Ajax










0















I would like to load the Details view of a news list via Ajax. The page reload is not a good UX - would be better for the old detail to fade out while the list stays in place on the left (or wherever) and just the detail view of the article change.



Problems:



  • SEO might break

  • Unique URLS for an article might be a problem without
    extending News

I am trying to get this to work:
https://gist.github.com/markhowellsmead/98de3dbaaec2faf52e0863907b5e403e



also looking at:
http://unterricht.lacheiner.net/index.php?id=217
Which is an example of loading more News List Items



I am also looking at getting the full detail URL and use that to load the detail from a page with a unique detail only template as
www.example.com/?type=9999
that only has the detail



lastly looking at URL Routing
http://www.softfinity.com/blog/an-simple-introduction-to-url-routing/










share|improve this question
























  • via ajax as if we are in year 2005

    – Daniel Khoroshko
    Nov 15 '18 at 12:40















0















I would like to load the Details view of a news list via Ajax. The page reload is not a good UX - would be better for the old detail to fade out while the list stays in place on the left (or wherever) and just the detail view of the article change.



Problems:



  • SEO might break

  • Unique URLS for an article might be a problem without
    extending News

I am trying to get this to work:
https://gist.github.com/markhowellsmead/98de3dbaaec2faf52e0863907b5e403e



also looking at:
http://unterricht.lacheiner.net/index.php?id=217
Which is an example of loading more News List Items



I am also looking at getting the full detail URL and use that to load the detail from a page with a unique detail only template as
www.example.com/?type=9999
that only has the detail



lastly looking at URL Routing
http://www.softfinity.com/blog/an-simple-introduction-to-url-routing/










share|improve this question
























  • via ajax as if we are in year 2005

    – Daniel Khoroshko
    Nov 15 '18 at 12:40













0












0








0








I would like to load the Details view of a news list via Ajax. The page reload is not a good UX - would be better for the old detail to fade out while the list stays in place on the left (or wherever) and just the detail view of the article change.



Problems:



  • SEO might break

  • Unique URLS for an article might be a problem without
    extending News

I am trying to get this to work:
https://gist.github.com/markhowellsmead/98de3dbaaec2faf52e0863907b5e403e



also looking at:
http://unterricht.lacheiner.net/index.php?id=217
Which is an example of loading more News List Items



I am also looking at getting the full detail URL and use that to load the detail from a page with a unique detail only template as
www.example.com/?type=9999
that only has the detail



lastly looking at URL Routing
http://www.softfinity.com/blog/an-simple-introduction-to-url-routing/










share|improve this question
















I would like to load the Details view of a news list via Ajax. The page reload is not a good UX - would be better for the old detail to fade out while the list stays in place on the left (or wherever) and just the detail view of the article change.



Problems:



  • SEO might break

  • Unique URLS for an article might be a problem without
    extending News

I am trying to get this to work:
https://gist.github.com/markhowellsmead/98de3dbaaec2faf52e0863907b5e403e



also looking at:
http://unterricht.lacheiner.net/index.php?id=217
Which is an example of loading more News List Items



I am also looking at getting the full detail URL and use that to load the detail from a page with a unique detail only template as
www.example.com/?type=9999
that only has the detail



lastly looking at URL Routing
http://www.softfinity.com/blog/an-simple-introduction-to-url-routing/







ajax typo3 tx-news typo3-9.x






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '18 at 23:14









Peter Kraume

774415




774415










asked Nov 15 '18 at 12:32









jaco graaffjaco graaff

46




46












  • via ajax as if we are in year 2005

    – Daniel Khoroshko
    Nov 15 '18 at 12:40

















  • via ajax as if we are in year 2005

    – Daniel Khoroshko
    Nov 15 '18 at 12:40
















via ajax as if we are in year 2005

– Daniel Khoroshko
Nov 15 '18 at 12:40





via ajax as if we are in year 2005

– Daniel Khoroshko
Nov 15 '18 at 12:40












1 Answer
1






active

oldest

votes


















0














I would not recommend this, as this will break default browser behavior like back and forward, will make it hard to link directly to a news item, etc. But if you really want to do this, I would do this by adding an click event to the a-tag for the link to the detail page in the list view, get the URL, fetch the detail page using ajax, then only get the part of the page I want and display it.



For example (using jQuery):



$('div.newsList div.item a').click(function() 
doStuffToShowItsLoading();

//
$.ajax(this.href,
dataType: 'html',
success: function(jqXHR, textStatus)
var detailHtml = $(jqXHR.responseText).find('div.newsDetails');
$('div.newsDetail').html(detailHtml);

doStuffToStopShowingItsLoading();
,
error: function()
alert('Something went wrong');

);
return false;
);


That way, the links can still be followed by search engines or people who have JavaScript disabled.






share|improve this answer























  • Thx Rudy - that is the direction I will be investigating - but I will also look at heavily leaning on hopefully using some new page-routing concepts.<br/> In a Javascript-app using Vue/Angular/React that has become standard to overcome the history and url-loading issue..<br/> My clients are complaining about the complete new page reload - obviously having seen the refresh-less behaviour on other sites<br/>

    – jaco graaff
    Nov 15 '18 at 22:54











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53319604%2ftypo3-v9-5-news-extension-load-with-ajax%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I would not recommend this, as this will break default browser behavior like back and forward, will make it hard to link directly to a news item, etc. But if you really want to do this, I would do this by adding an click event to the a-tag for the link to the detail page in the list view, get the URL, fetch the detail page using ajax, then only get the part of the page I want and display it.



For example (using jQuery):



$('div.newsList div.item a').click(function() 
doStuffToShowItsLoading();

//
$.ajax(this.href,
dataType: 'html',
success: function(jqXHR, textStatus)
var detailHtml = $(jqXHR.responseText).find('div.newsDetails');
$('div.newsDetail').html(detailHtml);

doStuffToStopShowingItsLoading();
,
error: function()
alert('Something went wrong');

);
return false;
);


That way, the links can still be followed by search engines or people who have JavaScript disabled.






share|improve this answer























  • Thx Rudy - that is the direction I will be investigating - but I will also look at heavily leaning on hopefully using some new page-routing concepts.<br/> In a Javascript-app using Vue/Angular/React that has become standard to overcome the history and url-loading issue..<br/> My clients are complaining about the complete new page reload - obviously having seen the refresh-less behaviour on other sites<br/>

    – jaco graaff
    Nov 15 '18 at 22:54
















0














I would not recommend this, as this will break default browser behavior like back and forward, will make it hard to link directly to a news item, etc. But if you really want to do this, I would do this by adding an click event to the a-tag for the link to the detail page in the list view, get the URL, fetch the detail page using ajax, then only get the part of the page I want and display it.



For example (using jQuery):



$('div.newsList div.item a').click(function() 
doStuffToShowItsLoading();

//
$.ajax(this.href,
dataType: 'html',
success: function(jqXHR, textStatus)
var detailHtml = $(jqXHR.responseText).find('div.newsDetails');
$('div.newsDetail').html(detailHtml);

doStuffToStopShowingItsLoading();
,
error: function()
alert('Something went wrong');

);
return false;
);


That way, the links can still be followed by search engines or people who have JavaScript disabled.






share|improve this answer























  • Thx Rudy - that is the direction I will be investigating - but I will also look at heavily leaning on hopefully using some new page-routing concepts.<br/> In a Javascript-app using Vue/Angular/React that has become standard to overcome the history and url-loading issue..<br/> My clients are complaining about the complete new page reload - obviously having seen the refresh-less behaviour on other sites<br/>

    – jaco graaff
    Nov 15 '18 at 22:54














0












0








0







I would not recommend this, as this will break default browser behavior like back and forward, will make it hard to link directly to a news item, etc. But if you really want to do this, I would do this by adding an click event to the a-tag for the link to the detail page in the list view, get the URL, fetch the detail page using ajax, then only get the part of the page I want and display it.



For example (using jQuery):



$('div.newsList div.item a').click(function() 
doStuffToShowItsLoading();

//
$.ajax(this.href,
dataType: 'html',
success: function(jqXHR, textStatus)
var detailHtml = $(jqXHR.responseText).find('div.newsDetails');
$('div.newsDetail').html(detailHtml);

doStuffToStopShowingItsLoading();
,
error: function()
alert('Something went wrong');

);
return false;
);


That way, the links can still be followed by search engines or people who have JavaScript disabled.






share|improve this answer













I would not recommend this, as this will break default browser behavior like back and forward, will make it hard to link directly to a news item, etc. But if you really want to do this, I would do this by adding an click event to the a-tag for the link to the detail page in the list view, get the URL, fetch the detail page using ajax, then only get the part of the page I want and display it.



For example (using jQuery):



$('div.newsList div.item a').click(function() 
doStuffToShowItsLoading();

//
$.ajax(this.href,
dataType: 'html',
success: function(jqXHR, textStatus)
var detailHtml = $(jqXHR.responseText).find('div.newsDetails');
$('div.newsDetail').html(detailHtml);

doStuffToStopShowingItsLoading();
,
error: function()
alert('Something went wrong');

);
return false;
);


That way, the links can still be followed by search engines or people who have JavaScript disabled.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 15 '18 at 12:45









Rudy GnoddeRudy Gnodde

1,2801218




1,2801218












  • Thx Rudy - that is the direction I will be investigating - but I will also look at heavily leaning on hopefully using some new page-routing concepts.<br/> In a Javascript-app using Vue/Angular/React that has become standard to overcome the history and url-loading issue..<br/> My clients are complaining about the complete new page reload - obviously having seen the refresh-less behaviour on other sites<br/>

    – jaco graaff
    Nov 15 '18 at 22:54


















  • Thx Rudy - that is the direction I will be investigating - but I will also look at heavily leaning on hopefully using some new page-routing concepts.<br/> In a Javascript-app using Vue/Angular/React that has become standard to overcome the history and url-loading issue..<br/> My clients are complaining about the complete new page reload - obviously having seen the refresh-less behaviour on other sites<br/>

    – jaco graaff
    Nov 15 '18 at 22:54

















Thx Rudy - that is the direction I will be investigating - but I will also look at heavily leaning on hopefully using some new page-routing concepts.<br/> In a Javascript-app using Vue/Angular/React that has become standard to overcome the history and url-loading issue..<br/> My clients are complaining about the complete new page reload - obviously having seen the refresh-less behaviour on other sites<br/>

– jaco graaff
Nov 15 '18 at 22:54






Thx Rudy - that is the direction I will be investigating - but I will also look at heavily leaning on hopefully using some new page-routing concepts.<br/> In a Javascript-app using Vue/Angular/React that has become standard to overcome the history and url-loading issue..<br/> My clients are complaining about the complete new page reload - obviously having seen the refresh-less behaviour on other sites<br/>

– jaco graaff
Nov 15 '18 at 22:54




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53319604%2ftypo3-v9-5-news-extension-load-with-ajax%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線