Image in activity stream

3 views
Skip to first unread message

sharath

unread,
Jun 16, 2008, 6:59:02 AM6/16/08
to Orkut Developer Forum
hello,

I have got the below code line for the body of an activity stream.
Only the image is getting displayed but not the corresponding text.


activity_params[opensocial.Activity.Field.BODY] = "<a href='/
AppInfo.aspx'><img src='http://hosting.gmodules.com/ig/gadgets/file/
default.jpg'>TEXT HERE</a>";

Kindly suggest the required modification

Thanks and Regards
Sharath

Jason

unread,
Jun 17, 2008, 8:57:35 PM6/17/08
to Orkut Developer Forum
Hi Sharath. I'm seeing both the image and text in Firefox 2.0.0.14 on
Mac OS X. Please provide your platform details (browser and OS) and a
screenshot, and I'll look into this further. Alternatively, you could
try using two anchor tags, one with the image and the other with the
text to see if this fixes the issue.

As an aside, HTML attributes should always be in double quotes. This
probably isn't causing your problem, but it could cause problems
later:

activity_params[opensocial.Activity.Field.BODY] = '<a href="/
AppInfo.aspx"><img src="http://hosting.gmodules.com/ig/gadgets/file/
default.jpg"/>TEXT HERE</a>';

- Jason

sharath

unread,
Jun 17, 2008, 9:16:44 PM6/17/08
to Orkut Developer Forum
Hi Jason,

I am also using the same version of firefox in windows XP.
I am getting only image but not text.
Better show me the syntax to use it as two separate tags.

Thanks
Sharath

Rohit Ghatol (Google)

unread,
Jun 18, 2008, 12:14:01 AM6/18/08
to Orkut Developer Forum
Hi Sharath,
I tried this on Windows XP box using firefox, it shows me the text
too.

Here is the complete example I tried to run in Code runner

function createActivity() {
var title= '';
title = ', Title ';
var activity_params=[];
activity_params[opensocial.Activity.Field.TITLE] = title;
activity_params[opensocial.Activity.Field.BODY] = '<a href="/
AppInfo.aspx"><img src="http://hosting.gmodules.com/ig/gadgets/file/
default.jpg"/>TEXT HERE</a>';
var activity = opensocial.newActivity(activity_params);

opensocial.requestCreateActivity(activity,
"HIGH",getCreateActivityResp);
}

function getCreateActivityResp(responseItem) {
console.log(responseItem);
var htmlout = '';
if(responseItem.hadError()){
//htmlout= 'has error: ' + responseItem.ErrorMessage;
//alert(responseItem.ErrorMessage +'has error');
}
else{
alert('create activity good!')
}
}


Thanks,
Rohit

sharath

unread,
Jun 18, 2008, 6:05:14 AM6/18/08
to Orkut Developer Forum
Hi,

The text is not coming when i try it in the sandbox.
How to use both text and image as separate tags in activity body.?
This approach may solve the issue

Thanks
Sharath

On Jun 18, 9:14 am, "Rohit Ghatol (Google)"

sharath

unread,
Jun 20, 2008, 12:32:43 AM6/20/08
to Orkut Developer Forum
Hi Rohit,

Any solution avbl yet for the image and not text appearing
simultaneously?

Regards
Sharath

On Jun 18, 9:14 am, "Rohit Ghatol (Google)"
<api_rohitgha...@google.com> wrote:

Pedro Teixeira

unread,
Jun 20, 2008, 10:32:53 AM6/20/08
to Orkut Developer Forum

Does any one know if param STREAM_FAVICON_URL is supported in orkut?

[]'s
Pedro

On Jun 20, 1:32 am, sharath <sharath2...@gmail.com> wrote:
> Hi Rohit,
>
> Any solution avbl yet for the image and not text appearing
> simultaneously?
>
> Regards
> Sharath
>
> On Jun 18, 9:14 am, "Rohit Ghatol (Google)"
>
> <api_rohitgha...@google.com> wrote:
> > Hi Sharath,
> > I tried this on Windows XP box using firefox, it shows me the text
> > too.
>
> > Here is the complete example I tried to run in Code runner
>
> > function createActivity() {
> > var title= '';
> > title = ', Title ';
> > var activity_params=[];
> > activity_params[opensocial.Activity.Field.TITLE] = title;
> > activity_params[opensocial.Activity.Field.BODY] = '<a href="/
> > AppInfo.aspx"><img src="http://hosting.gmodules.com/ig/gadgets/file/
> > default.jpg"/>TEXT HERE</a>';
> > varactivity= opensocial.newActivity(activity_params);
>
> > opensocial.requestCreateActivity(activity,
> > "HIGH",getCreateActivityResp);
>
> > }
>
> > function getCreateActivityResp(responseItem) {
> > console.log(responseItem);
> > var htmlout = '';
> > if(responseItem.hadError()){
> > //htmlout= 'has error: ' + responseItem.ErrorMessage;
> > //alert(responseItem.ErrorMessage +'has error');
> > }
> > else{
> > alert('createactivitygood!')

Jason

unread,
Jun 23, 2008, 5:23:10 PM6/23/08
to Orkut Developer Forum
Sharath: It looks like you're the only one who isn't seeing both the
image and text. Even so, try using two anchors instead of one and see
if this works for you:

var bodyMarkup = '<a href="/AppInfo.aspx"><img src="http://
hosting.gmodules.com/ig/gadgets/file/default.jpg"/></a>' + '<a href="/
AppInfo.aspx">TEXT HERE</a>';
activity_params[opensocial.Activity.Field.BODY] = bodyMarkup;

- Jason

Jason

unread,
Jun 23, 2008, 5:23:25 PM6/23/08
to Orkut Developer Forum
Pedro: Feel free to prove me wrong, but I don't believe
STREAM_FAVICON_URL is currently supported in orkut.

- Jason

On Jun 20, 7:32 am, Pedro Teixeira <pedr...@gmail.com> wrote:

sharath

unread,
Aug 18, 2008, 12:43:55 PM8/18/08
to Orkut Developer Forum
Hi Jason,

I tried this

var bodyMarkup = '<a href="/AppInfo.aspx"><img src="http://
hosting.gmodules.com/ig/gadgets/file/default.jpg"/></a>' + '<a href="/
AppInfo.aspx">TEXT HERE</a>';
activity_params[opensocial.Activity.Field.BODY] = bodyMarkup;

I am getting only image but not the text , kindly let me know the
solution

Thanks
Sharath

On Jun 24, 2:23 am, Jason <apija...@google.com> wrote:
> Sharath: It looks like you're the only one who isn't seeing both theimageand text. Even so, try using two anchors instead of one and see
> if this works for you:
>
> var bodyMarkup = '<a href="/AppInfo.aspx"><img src="http://
> hosting.gmodules.com/ig/gadgets/file/default.jpg"/></a>' + '<a href="/
> AppInfo.aspx">TEXT HERE</a>';
> activity_params[opensocial.Activity.Field.BODY] = bodyMarkup;
>
> - Jason
>
> On Jun 20, 7:32 am, Pedro Teixeira <pedr...@gmail.com> wrote:
>
> > Does any one know if param STREAM_FAVICON_URL is supported in orkut?
>
> > []'s
> > Pedro
>
> > On Jun 20, 1:32 am, sharath <sharath2...@gmail.com> wrote:
>
> > > Hi Rohit,
>
> > > Any solution avbl yet for theimageand not text appearing
> > > > > I am getting onlyimagebut not text.
> > > > > Better show me the syntax to use it as two separate tags.
>
> > > > > Thanks
> > > > > Sharath
>
> > > > > On Jun 18, 5:57 am, Jason <apija...@google.com> wrote:
>
> > > > > > Hi Sharath. I'm seeing both theimageand text in Firefox 2.0.0.14 on
> > > > > > Mac OS X. Please provide your platform details (browser and OS) and a
> > > > > > screenshot, and I'll look into this further. Alternatively, you could
> > > > > > try using two anchor tags, one with theimageand the other with the
> > > > > > text to see if this fixes the issue.
>
> > > > > > As an aside, HTML attributes should always be in double quotes. This
> > > > > > probably isn't causing your problem, but it could cause problems
> > > > > > later:
>
> > > > > > activity_params[opensocial.Activity.Field.BODY] = '<a href="/
> > > > > > AppInfo.aspx"><img src="http://hosting.gmodules.com/ig/gadgets/file/
> > > > > > default.jpg"/>TEXT HERE</a>';
>
> > > > > > - Jason
>
> > > > > > On Jun 16, 3:59 am, sharath <sharath2...@gmail.com> wrote:
>
> > > > > > > hello,
>
> > > > > > > I have got the below code line for the body of anactivitystream.
> > > > > > > Only theimageis getting displayed but not the corresponding text.

sharath

unread,
Aug 20, 2008, 11:22:29 AM8/20/08
to Orkut Developer Forum
Hi Jason,

Kindly look into this sooner.

Thanks
Sharath

On Aug 18, 9:43 pm, sharath <sharath2...@gmail.com> wrote:
> Hi Jason,
>
> I tried this
>
> var bodyMarkup = '<a href="/AppInfo.aspx"><img src="http://
> hosting.gmodules.com/ig/gadgets/file/default.jpg"/></a>' + '<a href="/
> AppInfo.aspx">TEXT HERE</a>';
> activity_params[opensocial.Activity.Field.BODY] = bodyMarkup;
>
> I am getting onlyimagebut not the text , kindly let me know the

Jason

unread,
Aug 22, 2008, 1:35:42 PM8/22/08
to Orkut Developer Forum
The image you linked to is broken so I can't determine its height, but
it's very possible that the image you're trying to use it too big and
the text is getting rendered outside of the activity frame. Try using
a smaller image that is less than 70 pixels high like the one at
http://www.office-backup.com/images/google_talk-icon.jpg.

- Jason

sharath

unread,
Aug 23, 2008, 1:04:03 AM8/23/08
to Orkut Developer Forum
Hi Jason,

Its working fine now, Thanks for the reply.

Thanks
Sharath

On Aug 22, 10:35 pm, Jason <apija...@google.com> wrote:
> Theimageyou linked to is broken so I can't determine its height, but
> it's very possible that theimageyou're trying to use it too big and
> the text is getting rendered outside of theactivityframe. Try using
> a smallerimagethat is less than 70 pixels high like the one athttp://www.office-backup.com/images/google_talk-icon.jpg.
Reply all
Reply to author
Forward
0 new messages