Saturday, May 19, 2012 | Register | Login 
Minimize
 Module Support Forums
 
 Forum Forum metaPost Forums metaPost Forums Providers - Ven... Providers - Ven... How do I insert Article Image as an Article Image to News Article using WLW? How do I insert Article Image as an Article Image to News Article using WLW?
Previous Previous
 
Next Next
New Post
 3/22/2010 5:49 PM
pcsk77
4 posts
No Ranking


How do I insert Article Image as an Article Image to News Article using WLW?
 
Hi, can you please help? With the latest version of News Articles, one can upload article images as a related image that's not part of the article detail or summary. Just wondering if Metapost allow me to upload such images using WLW? If so, how is that performed?

Thank you very much

Steven
 
New Post
 3/29/2010 3:51 AM
pcsk77
4 posts
No Ranking


Re: How do I insert Article Image as an Article Image to News Article using WLW?
 
Support? Can you help?

Thank you
 
New Post
 3/29/2010 11:04 AM
Don Worthley
333 posts
8th Level Poster


Re: How do I insert Article Image as an Article Image to News Article using WLW?
 

Scott changed the implementation of the article image.  The workaround to this issue is to create the following trigger on the article table.  The trigger will assign the images correctly based on the original implementation of the metaPost provider.  This means that after you execute the following SQL using the SQL tool from the hosts menu, you should be able to set the alternate text for the image you want to use as the article image to ai and the metaPost provider will associate this image as the article image.

---- Begin SQL ------

-- =============================================
-- Author:  Don Worthley, Old Town IT
-- Create date: 3/29/2010
-- Description: Trigger to Update Image Files for News Articles to New Format
-- =============================================
CREATE TRIGGER {databaseOwner}{objectQualifier}itc_metapost_news_articles_image_update
   ON  {databaseOwner}{objectQualifier}DnnForge_NewsArticles_Article
   AFTER INSERT,UPDATE
AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;

    INSERT INTO {databaseOwner}{objectQualifier}DnnForge_NewsArticles_Image(ArticleID, Title, FileName, Extension, Size, Width, Height, ContentType, Folder, SortOrder)
 SELECT
  a.ArticleID,
  f.FileName,
  f.FileName,
  f.Extension,
  f.Size,
  f.Width,
  f.Height,
  f.ContentType,
  f.Folder,
  0
 FROM
  {databaseOwner}{objectQualifier}DnnForge_NewsArticles_Article a INNER JOIN
   {databaseOwner}{objectQualifier}Files f ON 'FileID=' + CONVERT(varchar, f.FileID) = a.ImageUrl

 UPDATE
  {databaseOwner}{objectQualifier}DnnForge_NewsArticles_Article
 SET
  ImageUrl = NULL
 WHERE
  ArticleID IN (SELECT a.ArticleID FROM {databaseOwner}{objectQualifier}DnnForge_NewsArticles_Article a INNER JOIN {databaseOwner}{objectQualifier}Files f ON 'FileID=' + CONVERT(varchar, f.FileID) = a.ImageUrl)

 UPDATE
  {databaseOwner}{objectQualifier}DnnForge_NewsArticles_Article
 SET
  ImageCount = (SELECT count(*) FROM {databaseOwner}{objectQualifier}DnnForge_NewsArticles_Image i WHERE {databaseOwner}{objectQualifier}DnnForge_NewsArticles_Article.ArticleID = i.ArticleID)

END
GO

 
New Post
 4/14/2010 10:24 PM
pcsk77
4 posts
No Ranking


Re: How do I insert Article Image as an Article Image to News Article using WLW?
 
Hi Don,
  Thank you very much for the work around suggestion. However, I don't understand "you should be able to set the alternate text for the image you want to use as the article image to ai and the metaPost provider will associate this image as the article image.".

What do you mean by article image to ai? Is ai a special tag I can use? From your videos I know the tags [mp], [mp1], [tb1]...etc. But I haven't come across ai. Can you help and point me to the right place for this info?

Thanks

Steven
 
New Post
 4/19/2010 9:17 PM
Don Worthley
333 posts
8th Level Poster


Re: How do I insert Article Image as an Article Image to News Article using WLW?
 
Hi Steven,

Sorry for the confusion.  This was from a request a long time ago from a user who wanted to easily select one of the images in their post from WLW as the article image.  I don't recall if it was their suggestion, but somehow, the idea came about to set the alt attribute of the image to the short string ai.  The alt attribute is configured from the Advanced tab when you have an image selected.  It's managed in the textbox labeled Alternate text at the bottom.

HTH,

Don
 
Previous Previous
 
Next Next
 Forum Forum metaPost Forums metaPost Forums Providers - Ven... Providers - Ven... How do I insert Article Image as an Article Image to News Article using WLW? How do I insert Article Image as an Article Image to News Article using WLW?