Re: WODisplayGroup URLS
Re: WODisplayGroup URLS
- Subject: Re: WODisplayGroup URLS
- From: Gino Pacitti <email@hidden>
- Date: Sat, 25 Oct 2014 10:36:11 +0100
This is what I finally went for… any comments?
public void appendToResponse(WOResponse r, WOContext c){
try{
final String HOST = StaticVariables.HOSTFORAPPSERVER;
final String PREV_IS_HIDDEN_KEY = "prevIsHidden";
final String NEXT_IS_HIDDEN_KEY = "nextIsHidden";
final String PREV_KEY = "prevURL";
final String NEXT_KEY = "nextURL";
final String currentURL = HOST + "/" + c.request().uri();
final String nextURL = HOST + "/" + c.componentActionURL();
boolean hidePrevLink = Boolean.TRUE;
boolean hideNextLink = Boolean.TRUE;
if(!(itemsFromCategoryDisplayGroup.currentBatchIndex() == 1))
{
hidePrevLink = Boolean.FALSE;
}
if(itemsFromCategoryDisplayGroup.currentBatchIndex() != itemsFromCategoryDisplayGroup.batchCount())
{
hideNextLink = Boolean.FALSE;
}
NSDictionary metaHeadDictionary = new NSDictionary<Object,Object>(
new Object[]{hidePrevLink, hideNextLink, currentURL, nextURL},
new Object[]{PREV_IS_HIDDEN_KEY,NEXT_IS_HIDDEN_KEY,PREV_KEY,NEXT_KEY});
this.setPageDictionary(metaHeadDictionary);
}catch(Exception e)
{
e.printStackTrace();
}
}
> On 25 Oct 2014, at 09:57, Gino Pacitti <email@hidden> wrote:
>
> I think I am going with the easy solution of :
>
> System.out.println("Current URL .... " + this.context().request().uri());
> System.out.println("NEXT URL .... " + this.context().componentActionURL());
>
> This gives me the uri for the current clicked component and the other gives me the next component in line for page two of the list…
>
>
>
>
>> On 24 Oct 2014, at 22:55, Gino Pacitti <email@hidden> wrote:
>>
>> Yes I was thinking this might be the case... Problem being a SEO company has convinced the client that this is necessary and the lists already exist as component urls.... So I was just trying to load the next and previous to link tags so that it satisfied the requirement...
>>
>> I'll have to keep on searching... I have managed to convert the whole site to a great SEO structure though for urls in general... It's just this last results page!!!
>>
>> Sent from my iPad
>>
>>> On 24 Oct 2014, at 19:39, Ramsey Gurley <email@hidden> wrote:
>>>
>>> Hi Gino,
>>>
>>> A naive approach might be to try something like
>>>
>>> <link rel=‘next’ href=‘<webobject name=“Next”/>’ />
>>>
>>> Next: WOActionUrl {
>>> action = displayGroup.displayNextBatch;
>>> }
>>>
>>> But you will quickly discover that this doesn’t work. The url’s are dynamic and the spider will simply load list pages till the cows come home or it hits some preset limit. The urls won’t work later because, they are dynamic, and the search engine will notice that too.
>>>
>>> What you need is a way to represent your next/previous pages as a direct action, which can actually be impossible in some instances.
>>>
>>> Component actions are stateful and uses stateful urls. SEO wants stateless static urls. You might be able to pull off a direct action url for a simple list, but if you want to make a direct action to handle a list with nested lists which themselves have nested lists, as WO will let you easily do with components, you will very quickly run out of room for sort orderings, indexes, qualifiers, and list IDs in your direct action url. URLs are capped at ~2000 chars in some browsers and search engines, so there just isn’t room to represent all that state.
>>>
>>> Anyway, you can do it, but only in a limited way, and it’s basically going to be a one-off custom solution for your particular situation.
>>>
>>> Personally, I wouldn’t bother unless absolutely certain it would have a significant and measurable impact on page rank.
>>>
>>> Ramsey
>>>
>>>> On Oct 24, 2014, at 10:45 AM, Gino Pacitti <email@hidden> wrote:
>>>>
>>>> Hi there…
>>>>
>>>> Could anyone help me understand how to extract the next batch and previous batch URLs from a WODisplayGroup instance?
>>>>
>>>> Any help or pointing in the right direction would be greatly appreciated.
>>>>
>>>> Gino
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list (email@hidden)
>>>> Help/Unsubscribe/Update your Subscription:
>>>>
>>>> This email sent to email@hidden
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden